This repository now has automated bundle size tracking using size-limit.
We track the gzipped file sizes of the main entry points for:
- @reown/appkit - Main entry (~74 KB), React (~222 KB), and Vue (~74 KB) builds
- @reown/appkit-scaffold-ui - High-level UI flows (~201 KB)
- @reown/appkit-ui - Base UI components (~13 KB)
After building the packages, run:
# Build packages first
pnpm build
# Check bundle sizes
pnpm size
# See detailed breakdown of what's in a bundle
pnpm size:whyThe bundle_size job in .github/workflows/pr_checks.yml automatically:
- Builds all packages
- Runs
size-limitto measure sizes - Fails the PR if any package exceeds its size limit
- Posts a comment on the PR with bundle size results
@reown/appkit - Main Entry
Size limit: 80 kB
Size: 73.96 kB with all dependencies, minified and gzipped
Loading time: 1.5 s on slow 3G
Running time: 1.2 s on Snapdragon 410
Total time: 2.6 s
- Size - The gzipped file size (what gets sent over the network)
- Loading time - How long to download on slow 3G
- Running time - JavaScript parse/execution time on low-end mobile
- Total time - Combined loading + running time (UX impact)
Edit .size-limit.js to update limits:
{
name: '@reown/appkit - Main Entry',
path: 'packages/appkit/dist/esm/exports/index.js',
limit: '80 KB', // <-- Change this
gzip: true
}Guidelines:
- Set limits ~5-10% above current size (small buffer for organic growth)
- If a PR exceeds the limit, investigate what changed
- Only increase limits if the size increase is justified
To track additional packages, add entries to .size-limit.js:
{
name: '@reown/your-package',
path: 'packages/your-package/dist/esm/exports/index.js',
limit: '50 KB',
gzip: true
}Then run pnpm size to verify it works.
If pnpm size fails:
- "Can't find files at..." - The file doesn't exist. Build first with
pnpm build - "Can't resolve ..." - Ignore these for monorepo workspace deps (expected)
- "exceeded by X KB" - A package grew too large. Check what changed:
pnpm size:why
We measure file sizes rather than full webpack bundles because:
- Monorepo workspace dependencies - Webpack can't resolve
@reown/appkit-*workspace deps - Simpler - No webpack config needed
- Still useful - Catches bloat in individual packages
- CDN bundle tracked separately - The full bundle is in
@reown/appkit-cdn
For tree-shaking analysis, check published packages on bundlephobia.com.
✅ Accidentally adding large dependencies
✅ Code duplication across packages
✅ Unused code creeping in
✅ Bundle bloat over time