The useminPrepare
task does not actually do any minification, but instead it parses HTML and sets the appopriate configuration for other tasks. For example, if you have this in your HTML:
<!-- build:js js/app.js -->
<script src="js/app.js"></script>
<script src="js/controllers/thing-controller.js"></script>
<script src="js/models/thing-model.js"></script>
<script src="js/views/thing-view.js"></script>
<!-- endbuild -->
The useminPrepare
task will set the following configuration:
{
concat: {
'.tmp/concat/js/app.js': [
'app/js/app.js',
'app/js/controllers/thing-controller.js',
'app/js/models/thing-model.js',
'app/js/views/thing-view.js'
]
},
uglifyjs: {
'dist/js/app.js': ['.tmp/concat/js/app.js']
}
}
And the block in the HTML will then be replaced with with:
<script src="dist/js/app.js"></script>
For more information, see https://github.com/yeoman/grunt-usemin.