Batch Process YUI Compressor.

Referring to an article "Best Practices for Speeding Up Your Web Site" from YUI, minifying JavaScript and CSS can improve the load time of the web site. In the article, YUI provides a link to an useful tool – YUI Compressor.

Yahoo did a good job in YUI Compressor which contributed to a comprehensive tool and yet better compression ratio as compared to other tools  available (e.g JSMIN, Dojo’s Compressor). However, this tool has been given out as a command line tool without user interface. Hence, using it to compress multiple files can sometime be very tedious. Here, I have written a simple Window Batch file that helps mitigate the shortfall.

You may download the tool here. How to use this tool?

  1. Download the tool from the link provided above.
  2. Extract it.
  3. Copy your JavaScripts files and CSS files to a directory under BuildInput.
  4. Execute the YUICompress.bat file.
  5. Viola! Your YUI compressed JavaScripts files and CSS files will be available under BuildOutput.

Drop me comments if you found this useful. Thanks!


I don’t get paid for writing blog posts. Your “Like” is my only motivation, so please “Like” it if you found this information useful. Cheers!!!

Check out what other says about this post by clicking at the title of this post.

0 comment