Skip to content

Built-in bundle analysis

A bundle analyzer shows which modules make up each JavaScript bundle so you can find large dependencies. Only the Next port has an analysis step configured (pnpm analyze runs next analyze); none of the other ports do, so the rest of this section is capability only. Vite DevTools ships DevTools for Rolldown (@vitejs/devtools-rolldown), an ecosystem-level analyzer for production builds on Vite 8+. It is available to the ports on Vite 8 (not the Qwik and Fresh ports, which are on Vite 7) and is not counted in these labels.

11 / 14Other featureOne of 7 features that do not affect first paint. Together they are worth 14 of the 28 points.

Labels across 23 frameworks

  • 1st-party2
  • Experimental1
  • Third-party19
  • Manual1
  • of 23

Overview

Quoted text uses the source document's own marks: ✅ means 1st-party, 🧪 means Experimental or Third-party, and 🔧 means Manual.

We tested this feature in 15 Books ports. 15 passed. Each framework's card below shows what its test saw. How we test labels.

Labels record what each framework's documentation says it provides. They are not performance measurements. How the labels are assigned.

How to enable it, by framework

One card per framework, in the same order on every feature page. Where a framework has no built-in support (Manual), a short example shows how to build it yourself.

Next

1st-party2 ptsOverview

The Turbopack bundle analyzer (guide) shipped in v16.1 as next experimental-analyze and is next analyze as of v16.4.0 (the old name remains an alias). It opens the Turbopack module graph with per-route client/server filtering; --output saves a static report and next analyze export (v16.4.0+) streams the saved data. This port runs 16.4.6 and uses next analyze. The same guide covers the @next/bundle-analyzer plugin for webpack builds.

npx next analyze
npx next analyze --output

From the package bundling guide.

Nuxt

Experimental1 ptOverview

nuxt analyze (experimental) builds the app and serves client and Nitro reports; --json writes machine-readable output.

npx nuxt analyze [ROOTDIR] [--serve] [--prerender] [--json]

Adapted from the analyze command docs (other flags omitted). With Nuxt 5 behaviour the Nitro report needs rollup-plugin-visualizer. The non-experimental build.analyze config option also writes a client-bundle report during a normal nuxt build; with the default Vite builder it loads the community rollup-plugin-visualizer, which must be installed in the project (optional peer dependency), so the cell stays 🧪.

SvelteKit

Third-party1 ptOverview

No built-in analyzer; the performance docs suggest rollup-plugin-visualizer in vite.config.ts. Not configured in this port. No config snippet for it was found in the docs.

Code example

Add rollup-plugin-visualizer after sveltekit() in the Vite config. vite build then writes a treemap of the bundle to stats.html.

// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';

export default defineConfig({
	plugins: [
		tailwindcss(),
		sveltekit({ /* … */ }),
		visualizer({ filename: 'stats.html', gzipSize: true })
	]
});

Source: SvelteKit: Performance

SolidStart

Third-party1 ptOverview

No first-party analyzer is documented (archived SolidStart v2 docs cover asset handling but no analysis step); rollup-plugin-visualizer would be added, not configured here.

Code example

Add rollup-plugin-visualizer to the port's Vite config. vite build then writes a treemap of the bundle to stats.html.

// vite.config.ts
import { nitro } from 'nitro/vite'
import solid from '@solidjs/vite-plugin'
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    solid({ start: { /* … */ }, ssr: true }),
    nitro({ /* … */ }),
    visualizer({ filename: 'stats.html', gzipSize: true }),
  ],
})

Source: rollup-plugin-visualizer: README

No first-party analyzer is documented (production checklist); use rollup-plugin-visualizer, not configured.

Code example

Add rollup-plugin-visualizer to the plugin list. vite build then writes a treemap of the bundle to stats.html.

// vite.config.ts
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import { visualizer } from 'rollup-plugin-visualizer'

export default defineConfig({
  plugins: [
    tanstackStart(),
    viteReact(),
    visualizer({ filename: 'stats.html', gzipSize: true }),
  ],
})

Source: rollup-plugin-visualizer: README

Same (Solid hosting guide documents no analyzer): rollup-plugin-visualizer, not configured.

Code example

Add rollup-plugin-visualizer to the plugin list. vite build then writes a treemap of the bundle to stats.html.

// vite.config.ts
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
import viteSolid from '@solidjs/vite-plugin'
import { visualizer } from 'rollup-plugin-visualizer'

export default defineConfig({
  plugins: [
    tanstackStart(),
    viteSolid({ ssr: true }),
    visualizer({ filename: 'stats.html', gzipSize: true }),
  ],
})

Source: rollup-plugin-visualizer: README

Pracht

1st-party2 ptsOverview

pracht build --analyze prints per-route gzip and raw sizes; --json for scripts. Per-route budgets can fail the build (--no-budget-fail to opt out; CLI).

pracht build --analyze

From the performance guide.

Waku

Third-party1 ptOverview

No first-party analyzer is documented (migration guide covers none); rollup-plugin-visualizer, not configured here.

Code example

Add rollup-plugin-visualizer under vite.plugins in waku.config.ts. waku build then writes a treemap of the bundle to stats.html.

// waku.config.ts
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'waku/config';

export default defineConfig({
  vite: {
    plugins: [
      tailwindcss(),
      react(),
      visualizer({ filename: 'stats.html', gzipSize: true }),
    ],
  },
});

Source: rollup-plugin-visualizer: README

Ember

Third-party1 ptOverview

Embroider's Analyzing Bundles page says no Ember-specific analysis tooling is provided and points to Vite's performance guide and the community vite-bundle-visualizer (a CLI over rollup-plugin-visualizer); not configured here. ember-cli-bundle-analyzer covers classic and webpack builds.

Code example

Embroider points to the community vite-bundle-visualizer, a CLI wrapper around rollup-plugin-visualizer. It builds with the app's Vite config and writes a treemap.

# in the app root; Ember's config file is vite.config.mjs
npx vite-bundle-visualizer -c vite.config.mjs -o stats.html

Source: Embroider: Analyzing Bundles

Astro

Third-party1 ptOverview

No first-party analyzer documented; the official recipe adds rollup-plugin-visualizer, with a caveat that the report may not match what the client downloads. (analyze-bundle-size)

Code example

Astro's recipe adds rollup-plugin-visualizer as a Vite plugin. astro build then writes stats.html. The report covers the whole site, not each page.

// astro.config.mjs
import { defineConfig } from 'astro/config';
import { visualizer } from 'rollup-plugin-visualizer';

export default defineConfig({
  vite: {
    plugins: [visualizer({ emitFile: true, filename: 'stats.html' })],
  },
});

Source: Astro: Analyze bundle size

React Router

Third-party1 ptOverview

No first-party analyzer documented; the code-splitting page does not mention one; the third-party route is a community Vite/Rollup visualizer such as rollup-plugin-visualizer, added by hand. No React Router page recommends one. (code-splitting)

Code example

Add rollup-plugin-visualizer to the Vite config. react-router build then writes a treemap of the client bundle to stats.html.

// vite.config.ts
import { reactRouter } from '@react-router/dev/vite'
import tailwindcss from '@tailwindcss/vite'
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    tailwindcss(),
    reactRouter(),
    visualizer({ filename: 'stats.html', gzipSize: true }),
  ],
})

Source: rollup-plugin-visualizer: README

Qwik City

Third-party1 ptOverview

No visualizer/analyzer documented. First-party knobs: qwikVite entryStrategy and qsymbol-event analytics. The Insights lab is prototyping-stage. (bundle, insights)

Code example

Qwik has no analyzer of its own. Add rollup-plugin-visualizer to the base Vite config; vite build then writes a treemap of the client bundles.

// vite.config.ts
import { defineConfig } from 'vite'
import { qwikVite } from '@builder.io/qwik/optimizer'
import { qwikCity } from '@builder.io/qwik-city/vite'
import { visualizer } from 'rollup-plugin-visualizer'

export default defineConfig(() => ({
  plugins: [
    qwikCity(),
    qwikVite(),
    visualizer({ filename: 'stats.html', template: 'treemap', gzipSize: true }),
  ],
}))

Source: rollup-plugin-visualizer: README, Qwik: Bundle optimization

Angular (SSR)

Third-party1 ptOverview

ng build --stats-json writes a stats file for an external esbuild analyzer; default budgets warn 500kb/error 1mb on initial. The viewer is external. (build, build)

Code example

--stats-json writes browser-stats.json (and server-stats.json with SSR). Load it into the esbuild analyzer at esbuild.github.io/analyze. Budgets in angular.json fail the build when bundles grow.

ng build --stats-json
# then open https://esbuild.github.io/analyze/ and load dist/books/browser-stats.json
// angular.json, configurations.production
"budgets": [
  { "type": "initial", "maximumWarning": "500kB", "maximumError": "1MB" },
  { "type": "anyComponentStyle", "maximumWarning": "4kB", "maximumError": "8kB" }
]

Source: Angular CLI: ng build

Marko

Third-party1 ptOverview

The CLI has only dev, build, preview; the Vite plugin options are routesDir, adapter, trailingSlashes. No first-party analyzer documented; Marko Run builds with Vite, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (cli, vite-plugin)

Code example

Marko Run builds with Vite, so add rollup-plugin-visualizer next to the Marko plugin. marko-run build then writes a treemap of the client bundles.

// vite.config.ts
import { defineConfig } from "vite";
import marko from "@marko/run/vite";
import { visualizer } from "rollup-plugin-visualizer";

export default defineConfig({
  plugins: [
    marko(),
    visualizer({ filename: "stats.html", gzipSize: true, brotliSize: true }),
  ],
});

Source: rollup-plugin-visualizer README

Fresh

Third-party1 ptOverview

No first-party analyzer documented; the Vite page mentions only vite-plugin-inspect as a debugging aid. (vite)

Code example

Fresh has no analyzer. The Vite page suggests vite-plugin-inspect for looking at transforms during dev; for bundle sizes, add rollup-plugin-visualizer and run deno task build.

// vite.config.ts
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import inspect from "vite-plugin-inspect";
import { visualizer } from "rollup-plugin-visualizer";

export default defineConfig({
  plugins: [
    fresh(),
    inspect(), // dev UI at /__inspect
    visualizer({ filename: "stats.html", gzipSize: true }),
  ],
});

Source: Fresh: Vite

Analog

Third-party1 ptOverview

No first-party analyzer documented; Analog builds with Vite, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (deployment)

Code example

Add rollup-plugin-visualizer to the Vite config. vite build then writes a treemap of the client bundle.

// vite.config.ts (npm install -D rollup-plugin-visualizer)
import analog from '@analogjs/platform';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';

export default defineConfig(() => ({
  plugins: [
    analog(),
    visualizer({ filename: 'stats.html', gzipSize: true, template: 'treemap' }),
  ],
}));

Source: rollup-plugin-visualizer

Vike

Third-party1 ptOverview

No first-party analyzer documented; Vike is a Vite plugin, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (settings)

Code example

Add rollup-plugin-visualizer next to the Vike plugin. vike build then writes a treemap of the bundle to stats.html.

// vite.config.ts
import vike from 'vike/plugin'
import react from '@vitejs/plugin-react'
import { visualizer } from 'rollup-plugin-visualizer'

export default {
  plugins: [vike(), react(), visualizer({ filename: 'stats.html', gzipSize: true })],
}

Source: rollup-plugin-visualizer README

RedwoodSDK

Third-party1 ptOverview

No first-party analyzer documented; RedwoodSDK is a Vite plugin, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (hosting)

Code example

RedwoodSDK builds with Vite, so add rollup-plugin-visualizer to the plugins. The build writes stats.html with a treemap of the bundles.

// vite.config.mts
import { defineConfig, type PluginOption } from "vite";
import { redwood } from "rwsdk/vite";
import { cloudflare } from "@cloudflare/vite-plugin";
import { visualizer } from "rollup-plugin-visualizer";

export default defineConfig({
  plugins: [
    cloudflare({ viteEnvironment: { name: "worker" } }),
    redwood(),
    visualizer({ filename: "stats.html", gzipSize: true }) as PluginOption,
  ],
});

Source: rollup-plugin-visualizer: README

Remix 3

Manual0 ptsOverview

There are no bundles to analyze: the asset server compiles modules on request and the browser loads them one by one. remix assets lists every reachable file and remix assets inspect <url-or-file> explains one mapping; neither reports sizes. (files-and-assets, assets)

Code example

There is no bundle. The remix assets CLI lists every file the browser can reach and explains one URL. It reads the assets section of remix.json and does not report sizes.

// remix.json
{
  "$schema": "./node_modules/remix/schema/remix.json",
  "assets": {
    "basePath": "/assets",
    "allowFiles": ["app/routes.ts", "app/**/public/**"],
    "allowPackages": ["remix"],
    "files": { "extensions": [".svg", ".png", ".jpg", ".woff2"] }
  }
}
npx remix assets                                   # URL -> file for every reachable file
npx remix assets inspect /assets/app/ui/public/cart.ts

Source: Remix: Files and assets, debug asset URLs with remix assets

Void (React)

Third-party1 ptOverview

No first-party analyzer documented, and the CLI has no analyze command. Void is a Vite plugin, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (cli)

Code example

Void has no analyze command. Add rollup-plugin-visualizer to vite.config.ts for the client build.

// vite.config.ts
import { voidReact } from '@void/react/plugin'
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'
import { voidPlugin } from 'void'

export default defineConfig({
  plugins: [
    voidPlugin(),
    voidReact(),
    process.env.ANALYZE && { ...visualizer({ filename: 'dist/stats.html' }), applyToEnvironment: (env) => env.name === 'client' },
  ],
})

Source: rollup-plugin-visualizer · Void: CLI

Void (Vue)

Third-party1 ptOverview

No first-party analyzer documented, and the CLI has no analyze command. Void is a Vite plugin, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (cli)

Code example

Void has no analyze command. Add rollup-plugin-visualizer to vite.config.ts for the client build.

// vite.config.ts
import { voidVue } from '@void/vue/plugin'
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'
import { voidPlugin } from 'void'

export default defineConfig({
  plugins: [
    voidPlugin(),
    voidVue(),
    process.env.ANALYZE && { ...visualizer({ filename: 'dist/stats.html' }), applyToEnvironment: (env) => env.name === 'client' },
  ],
})

Source: rollup-plugin-visualizer · Void: CLI

Void (Svelte)

Third-party1 ptOverview

No first-party analyzer documented, and the CLI has no analyze command. Void is a Vite plugin, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (cli)

Code example

Void has no analyze command. Add rollup-plugin-visualizer to vite.config.ts for the client build.

// vite.config.ts
import { voidSvelte } from '@void/svelte/plugin'
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'
import { voidPlugin } from 'void'

export default defineConfig({
  plugins: [
    voidPlugin(),
    voidSvelte(),
    process.env.ANALYZE && { ...visualizer({ filename: 'dist/stats.html' }), applyToEnvironment: (env) => env.name === 'client' },
  ],
})

Source: rollup-plugin-visualizer · Void: CLI

Void (Solid)

Third-party1 ptOverview

No first-party analyzer documented, and the CLI has no analyze command. Void is a Vite plugin, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (cli)

Code example

Void has no analyze command. Add rollup-plugin-visualizer to vite.config.ts for the client build.

// vite.config.ts
import { voidSolid } from '@void/solid/plugin'
import { visualizer } from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'
import { voidPlugin } from 'void'

export default defineConfig({
  plugins: [
    voidPlugin(),
    voidSolid(),
    process.env.ANALYZE && { ...visualizer({ filename: 'dist/stats.html' }), applyToEnvironment: (env) => env.name === 'client' },
  ],
})

Source: rollup-plugin-visualizer · Void: CLI

Gotchas

  • Run the analyzer against a production build; development bundles are not representative.