Comments (17)
I guess this is feasible using the grunt templates and evaluating the package.json
...
I'm assigning myself to this to work on it later on.
from grunt-usemin.
Maybe just expose the grunt config and let the user add their package.json as they would do in the gruntfile?
from grunt-usemin.
It is possible in this very similar task (https://github.com/tactivos/grunt-htmlrefs).
However they don't have the replace of data-main
for RequireJS.
Maybe these 2 projects should join forces rather than develop 2 versions of the "same thing" ?
from grunt-usemin.
Maybe these 2 projects should join forces rather than develop 2 versions of the "same thing" ?
@khepin see https://github.com/tactivos/grunt-htmlrefs/blob/master/tasks/grunt-htmlrefs.js#L5-L8
Might just get it right from the source. @johnnyhalife Why create your own instead of contributing?
from grunt-usemin.
I'm happy to contribute back, i.e we're doing pretty much the same however, usemin does minification and other stuff too. I wrote it on the banner of our task, we just wanted the replacement not the minification magic.
We should find a way to do this together and I'll discard our version while we keep contributing back to yeoman.
from grunt-usemin.
We should find a way to do this together and I'll discard our version while we keep contributing back to yeoman.
Definitely! Happy to hear :)
Can you be a bit more specific what grunt-usemin does that you don't need?
from grunt-usemin.
Actually grunt-usemin
is not minifying by itself .. It is updating the min
config, but not launching min
by itself.
@johnnyhalife which part of grunt-usemin
(or usemin
) you're not using ?
from grunt-usemin.
So I created htmlrefs only because I needed to perform the replacements
we're not using minification at all (well, not through usemin we're using
google closure compilation, bundling, etc). Also I've added 2 new tasks
(include and remove) that we are using for updating our main index page (
https://github.com/tactivos/grunt-htmlrefs).
I'm thinking how about we keep to tasks but make one inherit the other
maybe? I'm fine moving htmlrefs to yeoman, and maybe we can override what
it does once it finds the blocks.
Just thinking out loud...
On Mon, Jan 14, 2013 at 8:52 PM, Frederick Ros [email protected]:
Actually grunt-usemin is not minifying by itself .. It is updating the minconfig, but not launching
min by itself.@johnnyhalife https://github.com/johnnyhalife which part of grunt-usemin(or
usemin) you're not using ?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-12246632.
from grunt-usemin.
Actually (and if I'm not wrong), the minification part of yeoman is done through min
and not really from grunt-usemin
(meaning it is part of a task, like 'useminPrepare rjs concat css min img rev usemin manifest'
).
So for this part, usemin
should not be a problem ... I'll have a look at how we could merge/inherit easily ;)
from grunt-usemin.
cc/ @sindresorhus I guess this could be added to the Gruntfile
template, by adding something like:
pkg: grunt.file.readJSON('package.json'),
at the beginning.
from grunt-usemin.
@sleeper Do you currently grunt.template.process() the paths from the usemin block? If so, then the above is the solution.
from grunt-usemin.
+1 to this, DRY!
from grunt-usemin.
Any news on this? Some times I end up using only useminPrepare. Easier to control my own versioning and leverage usemin in conjunction with other tools and packages. I made this fork of grunt-htmlref changing it's match pattern so I can use it together with usemin. Pull request have been issued.
from grunt-usemin.
Which PR are you referring to ?
from grunt-usemin.
@sleeper I guess the one on grunt-html that I've just merged
from grunt-usemin.
@asbjornenge it's published under 0.4.2
from grunt-usemin.
Yeah, it was that one. Since htmlref was mentioned earlier. Sorry for not clarifying @sleeper. Excellent @johnnyhalife !!
from grunt-usemin.
Related Issues (20)
- Timestamp at the End of JS/CSS Files HOT 4
- Usemin replacing meta tag content attributes
- throw a error when grunt run task
- usemin not handling self-closing HTML tags correctly HOT 1
- The default js flow should concat or uglify but not both HOT 1
- Custom pattern doesn't seem to work HOT 2
- grunt-usemin breaks when lodash 4.0.0 is used. HOT 1
- If a html file has Windows line feeds, usemin will silently not replace the blocks HOT 3
- Usemin CSS only gathers one file
- async defer trouble with AngularJS reCaptcha HOT 1
- question HOT 1
- Memory leak when generating sourcemap
- "js is not defined" warning while processing template HOT 2
- .NET MVC Project cshtml files not being updated HOT 6
- how to replace the prefix of script src file path!!!!!
- Problems with paths and rev
- Issue with renaming the block with asset versioning
- Usemin fails to update CSS file & JS file image paths correctly. HOT 1
- ..
- Use fixed name for minified files instead of revisioned name.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-usemin.