cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.3k stars 1.12k forks source link

Add bundle size metrics per PR #20629

Open jelly opened 5 months ago

jelly commented 5 months ago

Now that we have the option to output bundle information using ./build.js --metafile meta.json, the ESBuild bundle analyzer shows the bundle size. So in theory we could introduce a new github action which in a PR checks out main and runs another build and then compares the bundle size.

For plugins the index.js size would be:

jq -r '.outputs."dist/index.js".bytes' < meta.json

Can't easily find out big the total bundle size is

jelly commented 5 months ago

Tricky part is when we fail or how we show a drastic increase as the change can be warranted, say adding a new dependency.