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)

You can alsoCodeThe analysis command 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 period, the younger brother wroteProgramRun the ajaxmin program:
The Code is as follows:

Copy code The 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 \ 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.