Vite bundle compare
Drop one bundle-stats.json per side, generated by the
included Vite plugin (plugins/vite-plugin-bundle-stats.ts).
How to generate bundle-stats.json
-
Add the plugin to your Vite project
Copy
plugins/vite-plugin-bundle-stats.tsfrom this repo into your project, then register it in yourvite.config.ts:import { defineConfig } from 'vite'; import { bundleStats } from './plugins/vite-plugin-bundle-stats.ts'; export default defineConfig({ plugins: [bundleStats()], });The plugin works with both Rollup and Rolldown (
rolldown-vite) and only runs onvite build(not in dev). -
Build your app
Run
pnpm build(or your usual build command). The plugin writesbundle-stats.jsoninto your buildoutDir(by default at.vite/bundle-stats.json). -
Drop one file into each side above
To compare two builds, build your app twice (e.g. once on each branch) and save the file from each.
Everything runs in your browser — uploaded files stay on your machine and are persisted only to the browser's IndexedDB.