Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
434 views
in Technique[技术] by (71.8m points)

javascript - Compress all file .js with Google Closure Compiler Application in one File

I would like to Compress all my file .js in a same directory in one file with Google Closure Compiler in a command line.

For one file it's :

java -jar compiler.jar --js test.js --js_output_file final.js

But I didn't find in the doc how put my other file at the end of final.js without write over the last compress file ?

I would like something like that :

java -jar compiler.jar --js --option *.js --js_output_file final.js

It's possible or must I do a programm who add all file in a file and after compress it ? Thank you if you can help me !

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
java -jar path/to/closure-compiler/build/compiler.jar  
--js input_one.js  
--js input_two.js  
...  
--js_output_file compiled_output.js 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...