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.