java YUI 压缩器 - 将多个输入文件压缩成一个输出文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13957748/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 14:33:36  来源:igfitidea点击:

YUI compressor - compress multiple input files into one output file

javayui-compressor

提问by dev.e.loper

Possible Duplicate:
How can I combine and compress multiple script and css files for production use?

可能的重复:
如何组合和压缩多个脚本和 css 文件以供生产使用?

I would like to compress multiple javascript files into one minified file. I'm using YUI Compressor. On their page it says that it can do it like so (their example uses css files but I replaced it with js):

我想将多个 javascript 文件压缩成一个缩小的文件。我正在使用YUI 压缩器。在他们的页面上,它说它可以这样做(他们的示例使用 css 文件,但我用 js 替换了它):

java -jar yuicompressor.jar -o '.js$:-min.js' *.js 

When I try to execute this I get an empty file named .js$

当我尝试执行此操作时,我得到一个名为的空文件 .js$

What am I missing?

我错过了什么?

采纳答案by potato

The following works for me: java -jar yuicompressor.jar *.js > combined.js

以下对我有用: java -jar yuicompressor.jar *.js > combined.js