cockpit-project / cockpit

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

Add bundle size metrics per PR #20629

Open jelly opened 2 weeks ago

jelly commented 2 weeks 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 2 weeks 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.