Check the bundle size of the output build of any package with Vite.
pnpm i vite-size
In your package.json add the following script
"size": "npx tsc && vite-size"
You can also add external packages so they are not bundled
"size": "npx tsc && vite-size --externals <package-name> <another-package-name>"
--externals
should always be the last flag in the script.
pnpm run size
Use --lib
if you're not using an index.html
file.
"size": "npx tsc && vite-size --lib --externals <package-name> <another-package-name>"