uglifyjs最大压缩配置
配置:
uglify: {
options: {
mangle: {
//toplevel: true,
screw_ie8: true
},
compress: {
screw_ie8: true,
sequences: true,
//properties: true,
dead_code: true,
drop_debugger: true,
comparisons: true,
conditionals: true,
evaluate: true,
booleans: true,
loops: true,
unused: true,
hoist_funs: true,
if_return: true,
join_vars: true,
cascade: true,
//negate_iife: true,
drop_console: true
}
},
main: {
src: ['src/main.js'],
dest: 'dist/main.min.js'
}
},
运行
uglifyjs --self -c -m -o /tmp/uglifyjs.js