Search code examples
batch-fileyui

Batch file and YUI Compressor


How would I add the YUI compressor into this

@echo off
echo Combining.....
type lib\css\header.css>>stylesheet.css
type lib\css\footer.css>>stylesheet.css
echo Finished!
PAUSE

I would like it in simple terms so that I can understand how it works please, I've downloaded the latest build of YUI


Solution

  • The command for use YUI is :

    java -jar yuicompressor.jar original.css -o original.min.css
    

    Try this but specify the path of yuicompressor.jar :

    @echo off
    echo Combining.....
    type lib\css\header.css>>stylesheet.css
    type lib\css\footer.css>>stylesheet.css
    java -jar /path/to/yuicompressor.jar stylesheet.css -o stylesheet.min.css
    echo Finished!
    PAUSE