Vite plugin that outputs the total size of the bundle after build. Current stable version 1.0.8, released infrequently. It provides a simple way to display bundle size in the console, with options to filter files by regex, print per-file stats, and calculate gzip sizes. Unlike rollup-plugin-visualizer or webpack-bundle-analyzer, it focuses on minimal output and is easy to integrate into CI. Ships TypeScript types. Requires Vite >=5.0.0.
npm install vite-plugin-total-bundle-sizeVerified import paths — ran on the pinned version, not inferred.
Configures the Vite plugin with options: only .js/.css files, print per-file stats, disable gzip calculation.
Ensure you call totalBundleSize() in the plugins array, not just pass totalBundleSize.
Use import syntax or const { totalBundleSize } = require('vite-plugin-total-bundle-size') if the package supports it (it's ESM-first).Upgrade Vite to version 5 or above.
npm i -D vite-plugin-total-bundle-size
Use plugins: [totalBundleSize()]
Upgrade Vite to >=5.0.0