Shadow-cljs - Build Reports

Some time ago I started working on some functionality to make builds more inspectable. I was particulary interested in finding out what exactly ended up in my build after optimizations and how many bytes each part contributed.

The functionality has been there for a while now but not exactly easy to use and it was not documented at all. As of shadow-cljs@2.4.5 it is now much easier to quickly generate a report. The report itself generates a standalone HTML file that can be stored separately and requires not running server or external files. It is very useful to do before/after comparisons when trying to optimize certain JS includes.

Inspired by this recent post I uploaded two sample reports showing the difference of (:require ["antd/es/button"]) vs (:require ["antd"]).

The command to generate such a report for the :app build would be:

$ npx shadow-cljs run shadow.cljs.build-report app output.html

I plan on extending the report with some additional information over time since I also want to be able to quickly tell why something ended up in a build, ie. who included it.

10 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.