关于如何使用Google Closure Compiler结合多个javascript文件而不进行任何优化的任何想法? [英] Any ideas on how to use Google Closure Compiler to combine multiple javascript files w/o any optimizations?

查看:83
本文介绍了关于如何使用Google Closure Compiler结合多个javascript文件而不进行任何优化的任何想法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于如何使用Google Closure Compiler结合多个JavaScript文件而不进行任何优化的任何想法?具体来说,我们希望使用Closure来部署我们的组合站点JavaScript的两个版本:发布和调试。对于发布,我们使用 - compilation_level SIMPLE_OPTIMIZATIONS --manage_closure_dependencies ,它正在按预期工作。但是,对于调试,我们希望我们的JavaScript完整/未修改地组合以便于调试。似乎最低级别的优化是 WHITESPACE_ONLY ,任何想法都会受到赞赏。

Any ideas on how to use Google Closure Compiler to combine multiple JavaScript files w/o any optimizations? Specifically, we want to use Closure to deploy two versions of our combined site JavaScript: release and debug. For release, we are using --compilation_level SIMPLE_OPTIMIZATIONS --manage_closure_dependencies which is working as intended. However, for debug, we would like our JavaScript to be combined intact/unmodified for easier debugging. It seems the minimum level of optimization is WHITESPACE_ONLY, any ideas would be appreciated.

推荐答案

原来可以选择使用格式化已处理的JavaScript文件 - 格式化PRETTY_PRINT 。选项缩进/格式(带有空格)输出JavaScript文件,这样JavaScript很容易调试。

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 :)

这篇关于关于如何使用Google Closure Compiler结合多个javascript文件而不进行任何优化的任何想法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆