grunt-usemin
grunt-usemin copied to clipboard
How to configure usemin to only replace the files with the revved version of the filerev task
I don't want concatenation or uglification or to replace all the blocks in the html, I only want the usemin to replace the files with the revved version create by filerev task. However I still want to have the blocks defined in the html for full dist version (with uglify+concat etc...)
How is that possible? Thanks
@Avien, just an idea, but have you tried not to run the *min:generated
tasks ?
In your task list, instead of :
- useminPrepare
- concat
- cssmin
- uglify
- filerev
- usemin
you do:
- useminPrepare
- concat:mysubtask
- cssmin:mysubtask
- uglify:mysubtask
- filerev
- usemin
where mysubtask
is not generated
, you should prevent block replacement.
But what do you want to achieve but replacing files with revved version? Is it a scenario where you want to build a non-minified dist version, but still be able to build a full minified revved version ?
Exactly I want to build a debug able dist version which will always be deployed next to the minified version
Commenting the tasks in the build tasks alone did not work, it would still generate a minified version
Sent from my iPhone
On 25 באוק 2014, at 03:31, Stéphane Bachelier [email protected] wrote:
@Avien, just an idea, but have you tried not to run the *min:generated tasks ? In your task list, instead of :
- useminPrepare
- concat
- cssmin
- uglify
- filerev
- usemin you do:
- useminPrepare
- concat:mysubtask
- cssmin:mysubtask
- uglify:mysubtask
- filerev
- usemin where mysubtask is not generated, you should prevent block replacement.
But what do you want to achieve but replacing files with revved version? Is it a scenario where you want to build a non-minified dist version, but still be able to build a full minified revved version ?
— Reply to this email directly or view it on GitHub.
@Avien in my experience I never deploy debugable version on server, except if something fails, which means that I've setup my grunt tasks to build either a full optimized (minified+revved) version or a not optimized. Is it something you can consider ? If not I will take a look at building the two version (minified and non minified) at the same time. I think it's possible. Let me know.
ping @Avien
Actually I managed to skip the uglification task and copy the concatenated files to the dist folder to be revved by using grunt copy I think uglification does the copy inside?
@Avien I think the #487 should solve your problem in a better way. No need to have two differents workflow.
@Avien I confirm the #487 should probably cover your need and but not a duplicate of #487.
I add the docs
tag as we should add your use case in documentation.