Is there any bundle analyzer for vite?

Alternatively, you can use vite-bundle-visualizer, which uses rollup-plugin-visualizer:

npx vite-bundle-visualizer

Usage

# In your vite project's root
$ npx vite-bundle-visualizer
# Then open stats.html in browser
$ npx vite-bundle-visualizer --help

vite-bundle-visualizer

Usage:
  $ vite-bundle-visualizer <command> [options]

Options:
  --template -t <template>  Template to use, options are "raw-data" (JSON), "treemap", "list" (YAML), "sunburst" and "network" (default: treemap)
  --output -o <filepath>    Output file path, should be "**/*.html" or "**/*.json" (default: /Users/kuss/project/sides/oss/vite-bundle-visualizer/stats.html)
  --open <open>             Should open browser after generated, except when template is "json" (default: true)
  -h, --help                Display this message

Screenshots

Visualizer Templates

Treemap

$ npx vite-bundle-visualizer

treemap

Sunburst

$ npx vite-bundle-visualizer -t sunburst

sunburst

Network

$ npx vite-bundle-visualizer -t network

network

Raw data

Output raw data (JSON) of stats

# @deprecated vite-bundle-visualizer -t json
$ npx vite-bundle-visualizer -t raw-data

demo/stats.json

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)