{"id":20655,"library":"vite-bundle-visualizer","title":"vite-bundle-visualizer","description":"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.","status":"active","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/KusStar/vite-bundle-visualizer","tags":["javascript","vite","bundle-visualizer","bundle-analyzer","typescript"],"install":[{"cmd":"npm install vite-bundle-visualizer","lang":"bash","label":"npm"},{"cmd":"yarn add vite-bundle-visualizer","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-bundle-visualizer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying engine for generating visualizer HTML/JSON","package":"rollup-plugin-visualizer","optional":false}],"imports":[{"note":"CLI only, no programmatic API. 'json' template was renamed to 'raw-data' in v0.11.0.","wrong":"npx vite-bundle-visualizer --template json (use 'raw-data' instead)","symbol":"default (CLI)","correct":"npx vite-bundle-visualizer"},{"note":"This package has no programmatic export; use npx or install globally.","wrong":"import viteBundleVisualizer from 'vite-bundle-visualizer'","symbol":"viteBundleVisualizer (if programmatic)","correct":"Not available - CLI only"}],"quickstart":{"code":"npx vite-bundle-visualizer -o stats.html -t treemap --sourcemap","lang":"javascript","description":"Generates a treemap visualization of your Vite bundle with sourcemap-based sizes, outputting stats.html."},"warnings":[{"fix":"Ensure your project uses ESM (package.json type: module) or use npx.","message":"Package is ESM-only since v1.0.0. Cannot require() in CommonJS.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Replace -t json with -t raw-data.","message":"--template json is deprecated; use --template raw-data instead.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Upgrade Node.js to a supported version.","message":"Requires Node.js >=18.19.0 || >=20.6.0 due to dependency on modern Vite versions.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure vite.config.js exists or specify with -c.","message":"CLI runs vite build internally; your project must have a valid Vite config.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install -D vite-bundle-visualizer' or use 'npx vite-bundle-visualizer'.","cause":"Package not installed locally; npx may not find it if not in PATH.","error":"Error: Cannot find module 'vite-bundle-visualizer'"},{"fix":"Use import() dynamic import, or switch project to ESM, or use npx.","cause":"Using require() in CommonJS environment for ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Change to '--template raw-data' or '-t raw-data'.","cause":"Used deprecated -t json instead of -t raw-data.","error":"Error: Unknown argument: json"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}