Shane Fox's Blog

Saturday, February 9, 2008

After compressing and concatenating your javascript files with YUI Compressor like I showed last week, you will probably want to have your build process modify your html/jsp files to point to them. To do this you can use an Ant task called replaceregexp.

After doing all of this there is an important question that must be asked: Why? Well, now you can have all of you javascript code neatly separated into different files during development, but built into one file that is faster to download for production. Just remember to test the output of this procedure as it will modify your code.

Sunday, February 3, 2008

I recently spent some time wrestling with Ant and YUI Compressor.What I wanted to do was take a group of js files and run them through the compressor, and then append them into a single file in a specific order.