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

  1. Add the plugin to your Vite project

    Copy plugins/vite-plugin-bundle-stats.ts from this repo into your project, then register it in your vite.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 on vite build (not in dev).

  2. Build your app

    Run pnpm build (or your usual build command). The plugin writes bundle-stats.json into your build outDir (by default at .vite/bundle-stats.json).

  3. 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.