如何使用闭包编译器运行单遍?
Google 的 Closure Compiler jar 可执行文件有一个简洁的 --print_pass_graph
选项,该选项显示给编译器提供一组选项时正在执行的传递。
我感兴趣的是:如何运行单遍?
例如,如何运行单个 processDefines
步骤(可能带有依赖项),同时避免 denormalize
或 operaCompoundAssignFix
?
(跟进问题 是否有任何快速工具可以执行不断的替换而不删除 JavaScript 源代码中的注释?但它本身很有趣)
Google's Closure Compiler jar executable has a neat --print_pass_graph
option that shows what passes are being executed given a set of options to the compiler.
What I am interested in knowing is: how to run a single pass?
For example, how to run the single processDefines
step (possibly with dependencies), while avoiding denormalize
or operaCompoundAssignFix
?
(follow up question to Is there any fast tool which performs constant substitution without stripping out comments in JavaScript source code? but interesting by itself)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法可以做到这一点,但一种方法是将 DefaultPassConfig 替换为仅运行您想要的传递的自定义配置,Compiler 类的 setPassConfig 允许这样做:
http://www.google.com/codesearch#l5BkQmivP-Y/trunk/src/com/google/javascript/jscomp/Compiler.java&q=DefaultPassConfig%20package:http://closure-编译器%5C.googlecode%5C.com&l=692
There are a couple ways of doing this but one way is to replace the DefaultPassConfig with a custom one that only runs the pass you want, the Compiler class's setPassConfig allow this:
http://www.google.com/codesearch#l5BkQmivP-Y/trunk/src/com/google/javascript/jscomp/Compiler.java&q=DefaultPassConfig%20package:http://closure-compiler%5C.googlecode%5C.com&l=692