Uglifyjs
其实是为node.js准备的,需要在node.js环境才能使用,当然也有一些在线版本的服务。
如何安装:
npm install uglify-js -g
注释 : @note by yaochun 11-27
目前已经有UglifyJS2了,但是直接用新的去压缩以前的代码会有很多差别,如果还是想装1的:
npm install uglify-js@1
NOTE: The NPM package has been upgraded to UglifyJS2. If you need to install version 1.x you need to add `@1` to the command, as I did above. I strongly suggest you to try to upgrade, though this might not be simple (v2 has a completely different AST structure and API).
uglifyjs test.js -o test.min.js
扩展阅读:
1、https://github.com/mishoo/UglifyJS
2、在线服务:
http://marijnhaverbeke.nl/uglifyjs
http://app.baidu.com.cn/app/enter?appid=152856