How to automate JavaScript files compression with YUI Compressor?

后端 未结 6 1953
死守一世寂寞
死守一世寂寞 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条回答
  •  Happy的楠姐
    2020-12-13 21:59

    And for unix or cygwin you can use xargs or something like:

    ls -1 *.js | awk '{printf("java -jar yuicompressor.jar %s -o deploy/%s",$1,$1)}'

    Pipe that to /bin/sh when you're happy with the command line to execute it.

提交回复
热议问题