如何分析Closure编译器包大小 [英] How to analyze Closure Compiler bundle size

查看:98
本文介绍了如何分析Closure编译器包大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ClojureScript中有一个应用程序,它使用Google的Closure Compiler作为编译器后端。使用高级优化的结果捆绑包似乎太大了。我责怪依赖关系但是如何找出输出包中哪些模块占用的字节数最多?我扫描了所有Closure Compiler选项,但没有找到任何有用的东西。然后我尝试了解源映射并使用它来计算单个模块大小但没有成功。

I have an app in ClojureScript, which uses Google's Closure Compiler as a compiler backend. The resulting bundle using advanced optimizations seems way too big for what it is. I blame the dependencies but how do I find out which modules are taking the most bytes in the output bundle? I scanned through all the Closure Compiler options and didn't find anything useful. Then I tried to learn about source maps and use that to calculate individual module size but with no success.

我想要一个树状输出,我可以挖掘和找到最大的模块大小,例如。

I would like a tree-like output where I can dig in and find the biggest modules in terms of size, eg.


  • [+] goog 100kb


    • [+] goog.net 30kb

    • [+] goog 100kb
      • [+] goog.net 30kb

      • [+] my.namespace 30kb

      • [+] my.namespace 30kb

      推荐答案

      据我所知,这样的工具可以不存在。尽管如此,这将是一个很好的。

      To my knowledge, such a tool does not exist. It would be an excellent one to have though.

      该工具无需特定于Closure Compiler。相反,分析输出源映射可以将代码中的特定符号归因于特定的输入文件。

      The tool need not be specific to Closure Compiler. Instead, analyzing the output source map could attribute specific symbols in the code to specific input files.

      这篇关于如何分析Closure编译器包大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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