以前用的压缩一般是yui compressor。
重新找了一款uglify-js
https://www.npmjs.com/package/uglify-js
安装:
Install First make sure you have installed the latest version of node.js (You may need to restart your computer after this step). From NPM for use as a command line app: npm install uglify-js -g 这种可以在命令行使用 From NPM for programmatic use: npm install uglify-js
打开终端,就可以操作了。
uglifyjs source.js -o target.js
这样就可以手动的给一个js压缩了。