Home >Web Front-end >JS Tutorial >Getting Started with Uglifyjs (JS Code Optimization Tool) Installation and Use_Basic Knowledge

Getting Started with Uglifyjs (JS Code Optimization Tool) Installation and Use_Basic Knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:55:361547browse

You can also try the online version of Uglifyjs: http://sweet.fengyin.name/

You need to install node first, enter the command line, and check whether node and npm are installed correctly.

Next install UglifyJS, the command is: npm install uglify-js -g

Finally, don’t forget to add node and npm to the environment variables. Mine are

C:Program Files (x86)nodejs;

C:UserstaozhouAppDataRoamingnpm;

You can now use uglifyjs to compress it, such as

uglifyjs folder/dom.js -> folder/dom-min.js

The dom.js in the directory folder will be compressed and saved in the same directory.

Detailed parameter reference: https://github.com/mishoo/UglifyJS

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn