Information Technology Reference
In-Depth Information
Figure 13-4. A quick look at the YUI Compressor help screen as would be seen in a command line interface
Using YUI Compressor can seem intimidating (when looking at all the options, as seen in
Figure 13-4),but it's fairly straightforward. For example, assume I'd like to compress the
main.js file from our “Who's That Tweet?” app from Chapter 2. First I'd download the
YUI Compressor from its website. Then I'd extract the files, open a command line
window, and change to the directory containing the Java JAR file ( yuicompressor-
2.4.7.jar in this case; this name will change depending on version). Next I'd copy over
the files that I'd like to compress (into my current directory) and run the compression
command. The command I'd use to do this is:
java -jar yuicompressor-2.4.7.jar main.js -o main.small.js
 
Search WWH ::




Custom Search