Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

vite-bundle-explorer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-bundle-explorer

Bundle analyzer and visualizer tool for Vite

latest
Source
npmnpm
Version
0.3.4
Version published
Maintainers
1
Created
Source

vite-bundle-explorer

Bundle analyzer and visualizer tool for vite.

  • ✅ Supports both applications and libraries
  • ✅ Supports vite, rollup, rolldown and tsdown
  • ✅ Chunk treemap
  • ✅ Module import graph
  • ✅ Detect duplicated dependencies
  • ✅ Run checks during build

preview

How it works

vite-bundle-explorer consists of two main parts:

  • Vite Plugin: Gathers detailed build statistics in JSON format
  • CLI Utility: Serves a web interface for visualizing the data.

Usage

Install the package as a development dependency

npm install -D vite-bundle-explorer
# yarn add -D vite-bundle-explorer
# pnpm add -D vite-bundle-explorer

Next, add the statsPlugin to your vite config. This plugin will generate a stats.json file in your output directory on successful build, containing all bundle stats.

import { defineConfig } from 'vite';
import { statsPlugin } from 'vite-bundle-explorer/plugin';

export default defineConfig({
  plugins: [
    // ...other plugins
    statsPlugin(),
  ],
});

Once your build is complete and stats.json is generated, you can launch the web interface using the CLI utility:

npx vite-bundle-explorer ./dist/stats.json

Options

You can pass options to stats plugin

export default defineConfig({
  plugins: [
    statsPlugin({
      // ...options
    })
  ]
});
ParameterTypeDefaultDescription
enabledbooleantrueDisables stats collection and report generation. This option is disabled automatically for vite dev mode
reportCompressedSizebooleantrueCalculate compressed size of chunks. Might affect performance.
reportDirectoryNamestring"bundle-report"Name of the output directory
emitHtmlbooleantrueGenerate interactive HTML report
emitJsonbooleanfalseGenerate stats.json file
checkbooleantrueRun report checks during build
failOnWarningbooleanfalseCancel build if bundle has any report warnings

Keywords

vite

FAQs

Package last updated on 29 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts