[英]YUICompressor - compress multiple input to multiple output
I want to compress multiple input file into multiple output minified files like this : 我想将多个输入文件压缩成多个输出缩小文件,如下所示:
Input : 输入:
file1.css
file2.css
file3.css
Output: 输出:
file1-min.css
file2-min.css
file3-min.css
I'm trying to achieve that with the following command line : 我正在尝试通过以下命令行来实现:
java -jar yuicompressor-2.4.8.jar *.css -o $.min.css
It is not helping me at all > it creates a $.min.cs and not file1-min.css etc... 它根本没有帮助我>它创建了$ .min.cs而不是file1-min.css等...
You guys have an idea how to achieve that ? 你们有一个想法如何实现?
I have search some answer for this into stackoverflow, without success. 我已经为此寻找一些答案,但是没有成功。
Thanks for your help, Regards. 谢谢您的帮助,问候。
Update 更新
Here is the solution : 这是解决方案:
@echo off
setlocal
echo doing some css min
for %%F in (%cd% *.css) do (
echo %%~nF
java -jar yuicompressor-2.4.8.jar %%F -o min\%%~nF.min.css
echo "done"
)
)
I think you'll need to loop over your css files and call yuicompressor for each item. 我认为您需要遍历CSS文件并为每个项目调用yuicompressor。
For example, in windows batch 例如,在Windows批处理中
FOR /F %G IN ('dir /b C:\yourcssPath\*.css') DO java -jar yuicompressor-2.4.8.jar %G -o %G.min.css
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.