Search code examples
javascriptobfuscationminifywindows-shellyui-compressor

YUI Compressor - Automate Javascript Compression but skip some files


I am following the suggested answer on this SO post:

How to automate JavaScript files compression with YUI Compressor?

However, in my ~/Scripts folder, I have several jQuery files that are already compressed and minified. What do I need to do to automate it in a similar fashion but skip the jQuery files?


Solution

  • You could name all of your uncompressed files whatever.max.js, and then change the rule to something like this:

    for %%a in (*.max.js) do @java -jar yuicompressor.jar "%%a" -o "deploy\%%a"