Reputation: 4222
I generate two concatenated files using:
concat: {
header: {
src: [
// these will go in header
'assets/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js',
'assets/js/jquery-ui/jquery-ui.js',
'assets/js/select2/select2.min.js',
'assets/js/icheck/jquery.icheck.js',
'assets/uploadify/js/jquery.fileupload.js'
],
dest: 'assets/js/admin_header_common.js'
},
footer: {
src: [
'assets/js/vendor/bootstrap.min.js',
'assets/js/bootstrap-lightbox.min.js',
'assets/js/jqBootstrapValidation.js',
'assets/js/tinymce/tinymce.min.js',
'assets/js/common.js'
],
dest: 'assets/js/admin_footer_common.js'
}
},
Now I want to compress those two generated concatenated files so I did this:
// minify js
uglify: {
build: {
header: {
src: 'assets/js/admin_header_common.js',
dest: 'assets/js/admin_header_common.min.js'
},
top: {
src: 'assets/js/admin_footer_common.js',
dest: 'assets/js/admin_footer_common.min.js'
}
}
},
However the problem is that generated files are not getting compressed. Is above uglify
declaration fine or I am missing something ? I just need to compress two files and generate two separate destination files.
Many thanks for the help
Upvotes: 2
Views: 472
Reputation: 48476
Configure it like below
grunt.initConfig({
uglify: {
header: {
files: {
'assets/js/admin_header_common.min.js': 'assets/js/admin_header_common.js'
}
},
footer: {
files: {
'assets/js/admin_footer_common.min.js': 'assets/js/admin_footer_common.js'
}
}
}
});
Use uglify:header
for one, uglify:footer
for the other.
Upvotes: 5