JS optimization tool: ecmascript cruncher

Source: Internet
Author: User
Tags windows shell script

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.