Microsoft Ajax Minifier

Source: Internet
Author: User

Microsoft Ajax Minifier literally does not need to be explained, it is used to slim down javascript and CSS files.

In the current environment of Web2.0 and HTML5, more and more logic implementations are implemented through javascript

This program is an open-source microsoft Project. We can download it from codeplex.

If you are interested, we recommend that you download the source code.

Latest Version 4.27

For: http://ajaxmin.codeplex.com/releases/view/72146

The following is a simple method of use:

(In the doscommand environment, you don't need to talk about this. Everyone knows .)

Below is
After the sourcefile. js file is compressed, the output is
Parameters after outputfile. js
-Clobber
Indicates overwriting the previously generated file (if this parameter is not specified, the file is not overwritten)
 

ajaxmin.exe sourcefile.js –out outputfile.js –clobber 

We can use the-analyze parameter to analyze problems in the file.

ajaxmin.exe sourcefile.js –analyze

Of course, what we expect most is the file merging function. The syntax is also relatively simple.

 ajaxmin.exe source1.js source2.js source3.js –out outputfile.js

The above is a syntax with a standard suffix.

If the suffix of A javascript or css file is txt or other, we need to add the-CSS or-JS parameter to the display.

Of course, as a microsoft tool, Visual Studio is certainly supported.

Configure the csproj file of the Web project, that is, select a Web project in the project solution, right-click the project, and choose uninstall project.

As a result, the current project is unavailable. Right-click again and select to edit the ***. csproj file,

At this time, the IDE window opens the ***. csproj file and pulls it directly to the bottom of the file.

Of course, the specific path must be configured according to your own project.

<Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" />  <Target Name="AfterBuild">    <ItemGroup>      <JS Include="**\Scripts\*.js" Exclude="**\*.min.js;" />    </ItemGroup>    <ItemGroup>      <CSS Include="**\Styles\*.css" Exclude="**\*.min.css;" />    </ItemGroup>    <AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$"      JsTargetExtension=".min.js"       CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$"       CssTargetExtension=".min.css" />  </Target>

After the configuration is complete, reload the project. Compile and you will see many generated files ending with. min.

However, there is a problem that should be noted that the source code manager such as TFS may bring up a warning or error due to permission issues.

Finally, you can compare the YUI Compressor of Yahoo.

 

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.