如何将文件夹中的所有 js 压缩到新文件夹?
我在谷歌和stackoverflow上进行了搜索,我发现的只是 Compress all file .js with Google Closure Compiler Application in one File 将所有内容合二为一..+我们可以添加通配符或其他东西吗?
所以我可以做类似的事情
java -jar bin/compiler.jar ../../path/my/*.js --js_output_file ../../path/new/*.js
感谢您的关注
亚当·拉马丹
最佳答案
Bash 脚本来救援。类似的东西
files=`find ../../path/my -name "*.js"`
for i in $files;
do
java -jar bin/compiler.jar $i --js_output_file `dirname $i`../new/$i.js
done
(未测试)
关于google-closure-compiler - 使用谷歌闭包编译器将文件夹中的所有js压缩到新文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6871908/