For example: Im using the current configuration below to uglify
my JS scripts in my Gruntfile:
uglify: {
options: {
report: "min", //"gzip",
sourceMap: true,
preserveComments: false, //"some", "all"
},
application: {
options: {
// expand: true,
banner: '<%= app.banner %>',
preserveComments: "some"
},
src: 'dist/js/application.js',
dest: ".tmp/js/application.min.js"
},
dependencies: {
options: {
sourceMap: false
},
src: ['dist/js/dependencies.js'],
dest: ".tmp/js/dependencies.min.js"
},
Im aware that grunt-usemin generates the src and dest options from the code block in the html file declared in useminPrepare
gruntfile option, for example:
<!-- 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 -->
So how can I configure grunt-usemin
to use these same options, such as banner
, sourceMap: false
with the generated file blocks, I've read through the quick documentation usually given in github or NPM registry but seem not to find a solid answer to this.