zl程序教程

您现在的位置是:首页 >  后端

当前栏目

js压缩之uglify-js

JS 压缩
2023-09-27 14:21:59 时间

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