Minify CSS and Javascript Files With YUI Compressor From Linux Command Line

You can download YUICompressor from here:

http://yuilibrary.com/downloads/#yuicompressor

Extract the package

You need Java to execute it (on Ubuntu):

sudo apt-get install sun-java6-jre

To use it, you can execute this on the command line:

cat jquery-*.min.js library.js common.js lists.js tasks.js contexts-mgmt.js keys-mgmt.js | java -jar /home/dan/Desktop/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar –type js -o all`date +%Y%m%d%I%M%S`.js

This entry was posted in Web Design. Bookmark the permalink.

Leave a Reply