1

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?

Community
  • 1
  • 1
Brandon
  • 10,744
  • 18
  • 64
  • 97

2 Answers2

1

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"
sdleihssirhc
  • 42,000
  • 6
  • 53
  • 67
0

maybe something like this:

cd ~/Scripts
find . -name "*jquery*" -prune -o -type d -o -exec java -jar yuicompressor.jar -o '.js$:-min.js' {} +
mre666
  • 336
  • 2
  • 5