Skip to content

Bundle sizes

Every published dist/*.js ships pre-compressed .br + .gz siblings, and CI enforces a budget on every PR via andresz1/size-limit-action.

EntryBudgetActual
thai-qr-payment (full umbrella)25 KB13.7 KB
thai-qr-payment (renderThaiQRPayment only)25 KB13.6 KB
thai-qr-payment/payload sub-path5 KB3.09 KB
thai-qr-payment/qr sub-path6 KB4.74 KB
@thai-qr-payment/payload (full)5 KB3.09 KB
@thai-qr-payment/payload (payloadFor only)4 KB2.98 KB
@thai-qr-payment/qr6 KB4.75 KB
@thai-qr-payment/render2 KB1.24 KB
@thai-qr-payment/react1 KB256 B
@thai-qr-payment/assets20 KB4.83 KB

The umbrella started at 202 KB brotli — the brand SVG assets were embedded as base64-encoded raster inside SVG wrappers, and SVGO can’t shave a base64 blob. Two optimizations landed in v0.1.0:

  1. vtracer pass — every logo re-traced as a true vector SVG, then SVGO multipass. Drop: 202 KB → 18.5 KB (11× smaller).
  2. Drop alt logo variants-02 through -06 + PromptPay2 removed (commit bdadef3). Drop: 18.5 KB → 13.6 KB.

Total: 15× shrink from the original raster-embedded build.

All published JS bundles compress well — typical brotli ratio is 35-45%:

FileRawBrotliGzip
payload/dist/index.js8.3 KB2.98 KB3.5 KB
qr/dist/index.js13 KB4.5 KB5.2 KB
render/dist/index.js3.5 KB1.5 KB1.7 KB
react/dist/index.js1.2 KB449 B522 B

The size-limit.yml workflow runs on every PR. If a budget would be exceeded, the action comments the delta on the PR and fails the check. To raise a budget, edit .size-limit.json with a one-line justification in the commit.