如何使用闭包编译器运行单遍?

发布于 2024-12-25 01:51:04 字数 480 浏览 3 评论 0原文

Google 的 Closure Compiler jar 可执行文件有一个简洁的 --print_pass_graph 选项,该选项显示给编译器提供一组选项时正在执行的传递。

我感兴趣的是:如何运行单遍?

例如,如何运行单个 processDefines 步骤(可能带有依赖项),同时避免 denormalizeoperaCompoundAssignFix

(跟进问题 是否有任何快速工具可以执行不断的替换而不删除 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隐诗 2025-01-01 01:51:05

有几种方法可以做到这一点,但一种方法是将 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文