You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varresult=UglifyJS.minify("/path/to/file.js");console.log(result.code);// minified output// if you need to pass code instead of file namevarresult=UglifyJS.minify("var b = function () {};",{fromString: true});
package.json 文件中没有指定模块uglify-js的版本号,这个模块的新版本2.x跟1.x的API不一样,运行 node bin/build.js 时如果加了压缩代码的选项会出错。
uglify-js 新版本压缩代码的例子:
参考:https://github.com/mishoo/UglifyJS
The text was updated successfully, but these errors were encountered: