I recently started using GruntJS through Yeoman and I like the idea of Javascript minification, but it presents difficulties during development. I tried to disable uglify,usemin, etc in different combinations in the Gruntfile but everything seems to be dependent on another thing and breaks the process. Is there a simple way to disable minification? I am using the latest versionof Grunt offered by Yeoman to date, I found that older solutions have a different Gruntfile setup than that usd with Yeoman.
Here is my Gruntfile:
// Reads HTML for usemin blocks to enable smart builds that automatically
// concat, minify and revision files. Creates configurations in memory so
// additional tasks can operate on them
useminPrepare: {
options: {
dest: '<%= config.dist %>'
},
html: '<%= config.app %>/index.html'
},
This comment block was in your Gruntfile:
Based on this, removing the
<!-- Usemin block -->
from your index.html file should prevent theuseminPrepare
grunt task from minifying your javascript.Additionally, you can edit your
uglify
task to create new files to not overwrite your dev files by adding.min
to the file extension:I needed to tweak the usemin
flow:
option:as per yeoman grunt usemin's fine manual, the default
flow:
isHere is a gist of how I modified my yo webapp
Gruntfile.js
to removeuglify
from the flow.