css js 图片压缩批处理命令(基于YUI Compressor)
代码如下:
@echo off ::设置YUI Compressor启动目录 SET YUIFOLDER=D:\yuicompressor-2.4.2\build\ ::设置你的JS和CSS根目录,脚本会自动按树层次查找和压缩所有的JS和CSS SET INFOLDER=D:\jscss\src SET OUTFOLDER=D:\jscss\build echo 正在查找 JavaScript, CSS ... chdir /d %INFOLDER% for /r . %%a in (*.js *.css) do ( copy %%a "%OUTFOLDER%\" && echo 复制%%~fa成功 || echo 复制%%~fa失败,请检查文件是否存在! @echo 正在压缩 %%~a ... @java -jar %YUIFOLDER%\yuicompressor-2.4.2.jar --charset UTF-8 %%~fa -o %%~fa ) @echo CSS JS压缩完成! for /r . %%b in (*.gif) do ( @echo 正在查找 gif... @pngout %%~fb /kp del /q/f %%~fb ) @echo gif转换完成! for /r . %%c in (*.png) do ( @echo 正在查找 png... @pngout %%~fc ) @echo png压缩完成! pause & exit
相关推荐
NARUTOLUOLUO 2020-08-03
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18