How to analyze Closure Compiler bundle size

∥☆過路亽.° 提交于 2019-12-01 18:47:59

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

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.

shadow-cljs can generate Build Reports which take the advanced compiled output and analyze the source maps and then combines it with some of the compiler information to group sources by artifact and so on. The report is generated as a standalone .html file.

A sample build report can be found here. The build included "antd" package from npm. A comparison report that just included "antd/es/button" can be found here.

Note that this is limited to shadow-cljs as it relies on having all source map data available. Analyzing the source maps of CLJS builds generated by other tools misses source maps for all CLJSJS content and thus will include a lot of "gaps".

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