Any ideas on how to use Google Closure Compiler to combine multiple javascript files w/o any optimizations?

爷,独闯天下 提交于 2019-12-01 05:16:46
--formatting PRETTY_PRINT for beautifying
--debug true for meaningful names (after Advanced compilation)

Concatenation works like you'd expect it:

java -jar compiler.jar --js 1.js --js 2.js --js_output_file out.js

Two thoughts come to mind immediately. First - Why use closure compiler for that task, why not just something like cat jsfile1.js jsfile2.js > debug.js? Second - Closure Inspector will allow you to debug code compiled with Closure Compiler using FireBug.

To help you work with your transformed code, you can also install the Closure Inspector, a tool that makes it easy to use the Firebug JavaScript debugger with the Compiler's output.

Turns out there's an option to format the processed JavaScript file using the --formatting PRETTY_PRINT. The option indents/formats (with whitespace) the output JavaScript file, such that the JavaScript is easily debuggable.

Wish the documentation is a little more detailed/complete :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!