How to use uglify-es.minify:
8 9 10 11 12 13 14 15 16 17 18
const jszip = require('jszip'); let compressCode = function (jsFile, isMin) { if (fs.existsSync(jsFile)) { let data = fs.readFileSync(jsFile, 'utf-8'); let result = uglifyES.minify(data, { compress: { dead_code: true,// 移除未使用的code drop_console: true,//丢弃console代码,默认false drop_debugger: true,//丢弃debugger代码,默认true
282
612
43
See more examples