How to automate JavaScript files compression with YUI Compressor?

后端 未结 6 1952
死守一世寂寞
死守一世寂寞 2020-12-13 21:42

YUI Compressor does not accept wildcard parameters, so I cannot run it like this:

C:>java -jar yuicompressor.jar *.js

But I have over

6条回答
  •  一生所求
    2020-12-13 22:07

    You'll need to use some sort of a script to get a list of all the .js files, and then runs the YUI Compressor on all of them. On the windows command prompt, something like this should work:

    FOR %f IN (*.js) DO java -jar yuicompressor.jar %f -o deploy\%f
    

提交回复
热议问题