Compressing JavaScript Files

If your Web applications are deploying JavaScript files, then you should process those files through a JavaScript compressor before they are placed on the IIS server. A freely available one, JSMin, can be found at http://www.crockford.com/javascript/jsmin.html. JSMin offers significant compression results without modifying the actual source that is executed. Instead it performs noninvasive operations such as: remove comments and remove unnecessary white space. The JSCompress task available as a part of the MSBuildCommunityTasks incorporates JSMin to compress JavaScript files.

The WebApplication1 project from the samples includes a Scripts folder that contains some JavaScript source files. These files were taken from ...

Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.