是否可以在uglify js instaed of uglifying in separely中编译每个文件到一个文件。
uglifyjs assets / src / js / * js -o assets / dist / js / * .min.js -c
像这样答案 0 :(得分:0)
module.exports = function(grunt) {
grunt.config.set('uglify', {
options: {
mangle: false,
sourceMap: false,
screwIE8: true,
compress: {
unused: false,
drop_console: true
}
},
uglifyjsfiles:{
files: grunt.file.expandMapping(['.tmp/public/js/app/**/*.js'], '', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
};
现在运行grunt uglify:uglifyjsfiles