12345678910111213141516171819202122232425262728293031323334 |
- @echo off
- ::::echo 开始压缩文件 >> log.txt
- ::echo 开始压缩文件
- ::
- :::: 设置压缩JS文件的根目录,脚本会自动按树层次查找和压缩所有的JS
- ::SET JS_DER=..\client\games_ns\release\web\js
- ::::chdir /d %JS_DER%
- ::for /r %JS_DER% %%a in (*.js) do (
- :: ::echo 正在压缩 %%~a ... >> log.txt
- :: echo 正在压缩 %%~a ...
- :: terser %%~fa -m -o %%~fa
- ::)
- SET TARGET_DER=%1
- ::chdir /d %TARGET_DER%
- for /r %TARGET_DER% %%a in (*.js) do (
- ::echo 正在压缩 %%~a ... >> log.txt
- echo 正在压缩 %%~a ...
- terser %%~fa -m -c -o %%~fa
- )
- ::echo 全部压缩完成! >> log.txt
- ::echo %date:~0,10% %time:~0,8% >> log.txt
- pause
- ::terser bundle.js -m -o bundle.min.js
- ::uglifyjs bundle.js -m -o bundle.min.js
|