vite-size is a lightweight CLI tool that measures the bundle size of any Vite build output. It provides quick feedback on bundle size directly from the terminal without needing additional reporting tools. The current stable version is 0.0.6, released as an early-stage package with no fixed release cadence. Key differentiators include simple setup via npm scripts, support for external packages via --externals flag, and a --lib mode for library projects without an index.html. It ships TypeScript types and works with any Vite project.
npm install vite-sizeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up a size check script in package.json, including externals and lib mode flags.
Always put --externals at the end of the command line arguments.
Run npx tsc first or ensure your build is up-to-date.
Use CLI via npx or scripts; do not attempt to import from Node.js.
Install as dev dependency: pnpm i -D vite-size or run via npx: npx vite-size
Add --lib flag: vite-size --lib