js压缩之uglify-js

以前用的压缩一般是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压缩了。

posted @ 2021-01-08 09:47  jiduoduo  阅读(798)  评论(0编辑  收藏  举报