Registry / devops / vite-bundle-visualizer

vite-bundle-visualizer

JSON →
library1.2.1jsnpmunverified

Vite-bundle-visualizer v1.2.1 is a CLI tool to visualize Vite bundle sizes using rollup-plugin-visualizer. It generates interactive treemap, sunburst, network, raw data JSON, or list views. Unlike rollup-plugin-visualizer (a Vite plugin), this is a standalone CLI that runs `vite build` internally, so no plugin config needed. It requires Node ^18.19.0 || >=20.6.0, is ESM-only since v1.0.0, ships TypeScript types, and is actively maintained with monthly releases.

npm install vite-bundle-visualizer
INSTALL
IMPORT
SIG · VITE-BUNDLE-VISUAL
V
vite-bundle-visualizer
devopsjavascriptv1.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (CLI)
npx vite-bundle-visualizer
npx vite-bundle-visualizer --template json (use 'raw-data' instead)
CLI only, no programmatic API. 'json' template was renamed to 'raw-data' in v0.11.0.
viteBundleVisualizer (if programmatic)
Not available - CLI only
import viteBundleVisualizer from 'vite-bundle-visualizer'
This package has no programmatic export; use npx or install globally.

Generates a treemap visualization of your Vite bundle with sourcemap-based sizes, outputting stats.html.

npx vite-bundle-visualizer -o stats.html -t treemap --sourcemap
vite-bundle-visualizer --version
Debug
Known issues
breakingPackage is ESM-only since v1.0.0. Cannot require() in CommonJS.
fix
Ensure your project uses ESM (package.json type: module) or use npx.
affects: >=1.0.0
deprecated--template json is deprecated; use --template raw-data instead.
fix
Replace -t json with -t raw-data.
affects: <1.0.0
gotchaRequires Node.js >=18.19.0 || >=20.6.0 due to dependency on modern Vite versions.
fix
Upgrade Node.js to a supported version.
affects: all
gotchaCLI runs vite build internally; your project must have a valid Vite config.
fix
Ensure vite.config.js exists or specify with -c.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'vite-bundle-visualizer'
Package not installed locally; npx may not find it if not in PATH.
fix
Run 'npm install -D vite-bundle-visualizer' or use 'npx vite-bundle-visualizer'.
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() in CommonJS environment for ESM-only package.
fix
Use import() dynamic import, or switch project to ESM, or use npx.
Error: Unknown argument: json
Used deprecated -t json instead of -t raw-data.
fix
Change to '--template raw-data' or '-t raw-data'.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies
rollup-plugin-visualizerrequiredUnderlying engine for generating visualizer HTML/JSON
Agent activity
6 hits · last 30 days
node
6
Resources
vite-bundle-visualizer — npm install vite-bundle-visualizer · libregistry