My js and css contacts include jsMin, jsPacker, yui compressor, and google Closure compress.
These compression comparison of many articles, of which google Closure compress many people advocate, I also recommend it, here YU Bo students summarized the yui compressor and google Closure compress comparison: http://www.slideshare.net/lifesinger/closure-compiler-vs-yuicompressor
Recently, I found that yui compressor2.4.2 has some problems in compressing and confusing js scripts, so I want to change it to google Closure compress immediately. However, I am lazy and don't want to change the content of the ant script for automated packaging. In addition, many compression tools I have not collected execution programs and cannot be executed automatically. Try the latest yui compressor version yui compressor2.4.7 In the lazy method. The problem is solved.
Here I found some precautions for yui compressor2.4.2 for reference only:
1) after compression obfuscation, You can manually or automatically write data at the beginning. "<! -- ", Write at the end" --> ". This is not the reason.
2) // "and" */"cannot be in the same row; otherwise, an error is returned.
For example:
Error:
/* Var s = 2;
Var m = 1; // define */
Correct:
/* Var s = 2;
Var m = 1; // define
*/
3) Chinese problems.
However, I found that some Chinese characters have problems (I have to go further here to find out the cause)
For example, var s = "" will report an error. If there is an error in "Multi-end" compression obfuscation, you can load a space behind the multiple to solve the problem.
But now, version 2.4.7 has been completely resolved. V5