Introduction to Yui Compressor
JS/CSS file compression tools, compression causes and the role of their own brain fill, more information can be viewed in the http://yui.github.io/yuicompressor/
Address: https://github.com/yui/yuicompressor
How to Use
First of all to ensure that JDK is installed, JDK installation, refer to the http://www.cnblogs.com/chyingp/archive/2013/04/09/jdk.html
The following is a simple example (Operations in macx console are similar to those in Windows)
1. first go to the Yui comprossor build directory
You can see that there isYuicompressor-2.4.8pre.jar
Frontendtool/yuicompressor-master/build
2. Create a. js and B. JS, and write some content to it. Take a. js as an example:
'Vim A. js'
The contents of A. js are as follows:
Function Hello (Nick) {var Country = 'China'; console. Log (Nick) ;}hello ('casper ');
3. Example of Single File compression
Java-jar yuicompressor-2.4.8pre.jar A. js-O a-min.js
Compressed file a-min.js
Function Hello (a) {console. Log (a)} Hello ("Casper ");
4. Multi-File compression example
Java-jar yuicompressor-2.4.8pre.jar '. js $:-min. js' *. js
Role: A. JS, B. js are compressed into a-min.js, b-min.js
Use with ant
Todo