nitro
nitro copied to clipboard
build: bundle dependencies to reduce install size
(experimental draft)
This is an experimental attempt in order to reduce the total install size of nitro.
What is bundled: (check build.config)
What is not bundled:
- Runtime dependencies
- Native dependencies
- Incompatible to bundle
- Deps used by presets
- Common deps
Results:
- Before:
74MB/5,415 files - After:
48MB/3,300 files
bundled dist+deps: 4.6MB
Breakdown of remaining external deps: (linux/pnpm -- total is 49MB ignoring 1MB of overlaps for simplicity)
- utils:
2.6MB(croner, globby, klona, unplugin) - error:
2.1MB(youch youch/core source-map) - rollup (without plugins):
7.7MB - esbuild:
10MB -
@vercel/nft:10MB - unjs:
12MB(confbox consola compatx cookie-es crossws db0 defu destr h3 hookable jiti node-mock-http mlly pathe pkg-types ofetch ohash radix3 scule std-env ufo uncrypto unctx unenv unstorage)
Deploying nitrojs with
Cloudflare Pages
| Latest commit: |
ee92e2d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://51bbb964.nitrojs.pages.dev |
| Branch Preview URL: | https://build-inline-deps.nitrojs.pages.dev |
reworking with progressive attempts starting with #3619