Search code examples
javascriptwindowsyuiyui-compressor

Command Line Options For YUI Compressor


This is probably a quick question. I'd like to run the YUI compressor so that, instead of overwriting all of the javascript files in the input directory, it dumps the output files into a subdirectory called min. I would like to do something like

java -jar yuicompressor-2.4.7.jar -o *.js .\min\*.js c:\MyJavascriptDirectory\*.*

but instead it just overwrites the existing files with the minified files. Does anyone know the correct syntax to accomplish this?

Thanks!


Solution

  • I'm not sure of the correct syntax to do that, but someone has made a modification so that you can set up your output directory as follows

    java -jar yuicompressor.jar --output-dir /some/folder/for/compressed/js *js
    

    This allows you to have a source folder and a compressed folder. As opposed to having source and a bunch of -min.js files in the same folder.

    You can download the mod at the bottom of the page here http://yuilibrary.com/projects/yuicompressor/ticket/2528131