最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Command Line Options For YUI Compressor - Stack Overflow

programmeradmin4浏览0评论

This is probably a quick question. I'd like to run the YUI pressor 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 yuipressor-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 acplish this?

Thanks!

This is probably a quick question. I'd like to run the YUI pressor 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 yuipressor-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 acplish this?

Thanks!

Share Improve this question asked Mar 24, 2012 at 15:16 AndrewAndrew 6,54411 gold badges39 silver badges56 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

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 yuipressor.jar --output-dir /some/folder/for/pressed/js *js

This allows you to have a source folder and a pressed 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./projects/yuipressor/ticket/2528131

java -jar yuipressor.jar -o '.js$:-min.js' *.js will minify all .js files and save them as -min.js then you could just move all those files: mkdir min; mv *-min.js min/.

Source

发布评论

评论列表(0)

  1. 暂无评论