Don't parse irrelevent options to uglifyjs

This commit is contained in:
weyusi 2018-09-27 17:40:38 +09:30
parent 7b03521154
commit 0022702822
1 changed files with 3 additions and 2 deletions

View File

@ -78,10 +78,11 @@ function logic_js(str, data) {
} }
} }
//uglifyjs doesn't like 'enable' option //uglifyjs doesn't like irrelevant options
delete options.enable delete options.enable
delete options.logger
delete options.exclude
var result = UglifyJS.minify(str, options); var result = UglifyJS.minify(str, options);
console.log(result.error);
var saved = ((str.length - result.code.length) / str.length * 100).toFixed(2); var saved = ((str.length - result.code.length) / str.length * 100).toFixed(2);
if (options.logger) { if (options.logger) {
var log = hexo.log || console.log; var log = hexo.log || console.log;