Ecmascript cruncher developed by Thomas loo (ESC can be downloaded at http://www.saltstorm.net/depo/esc/or 51ajax.com ). ESC is a small window shell script.
Ecmascript cruncher developed by Thomas loo (ESC can be downloaded ). ESC is a small window shell script. To run ESC, you must use Windows. Open a console window and enter the following command:
Cscript Esc. WSF-L [0-4]-Ow outputfile. js inputfile. js
In the first part, cscript is a Windows shell script interpreter. The file name Esc. WSF is the program of ESC. Then there is the compression level. A value ranging from 0 to 4 indicates the level to be optimized. -Ow indicates that the next parameter is the optimized output file name. Finally, the remaining parameters are the JavaScript files to be optimized. You can provide only one file to be optimized, or you can have multiple files (multiple files will be placed in the output file in order after optimization ).
The following four optimization levels are supported by ESC:
0: it is useful to combine multiple files into a single file without changing the script;
1: Delete all comments;
2: In addition to level 1, delete additional tabs and spaces;
3: In addition to level 2, delete the line feed;
4: Except Level 3, replace the variable name.
ESC is good at replacing variable names with meaningless names. It does not change the constructor name, public feature, and public method name.
When using ESC, remember that if a javascript references the constructor in another file, Level 4 optimization will replace the reference to the constructor with a meaningless name. The solution is to combine the two files into one, so that the name of the constructor is maintained.