Microsoft Ajax Minifier Method for compressing javascript

Source: Internet
Author: User

However, the commonly used command is ajaxmin-a-h inputfile. js-o outputfile. js (this is a high compression mode)

The command for analyzing JS Code is ajaxmin inputfile. js-a-w: 3.


For more instructions, see Help.
Ajaxmin.exe download the Microsoft AJAX Library (sixth preview version)
When Ajaxmin compresses multiple files:
Ajaxmin-inputfile_1-inputfile_2-o-oututfile/Eo: UTF-8/Ei: UTF-8
Where
/Eo: UTF-8/Ei: UTF-8 indicates the input/output format. If not specified, the default ASCII code is used.
During the simple process, the younger brother wrote a program to execute the Ajaxmin program:
The Code is as follows:
Copy codeThe Code is as follows:
Public void ExecuteCommond (List <string> inputfileLis, string outfile)
{
For (int I = 0; I <inputfileList. Count; I ++)
{
CompressCode + = inputfileList [I] + "";
}
CompressCode + = "-o" + outfile + "/Eo: UTF-8/Ei: UTF-8 ";
System. Diagnostics. Process p = new System. Diagnostics. Process ();
P. StartInfo. FileName = @ "C: \ Program Files \ Microsoft Ajax Minifier \ ajaxmin.exe"; // name of the Program to be started
P. StartInfo. Arguments = CompressCode; // the startup parameter.
P. Start (); // Start
}

This is faster than manually entering commands.

Related Article

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.