Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

vite-bundle-explorer

Package Overview
Dependencies
Maintainers
1
Versions
10
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
1.0.0
Version published
Maintainers
1
Created
Source

vite-bundle-explorer

A powerful bundle analyzer and visualizer tool for Vite and any other Rollup-compatible bundler.

Analyze your bundle size, detect duplicate dependencies, and visualize module graphs to optimize your application's performance.

Features

  • Multi-Bundler Support – Works with any Rollup-compatible bundler like vite, rollup, rolldown, and tsdown.
  • 📦 Universal – Supports both Applications and Libraries.
  • 📊 Visual Insights – Interactive Chunk Treemap and Module Import Graph.
  • 🔍 Deep Analysis – Detect duplicated dependencies, trace dependencies to identify exactly why module is bundled.
  • 🛡️ Build Checks – Run checks during the build process.

Example report

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

Register the plugin (config name depends on your bundler, here is an example for vite).

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

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

Once your build is complete, you can use CLI or any static file server to see the interactive visualization.

npx vite-bundle-explorer bundle-report

Configuration

You can pass options to stats plugin

export default defineConfig({
  plugins: [
    statsPlugin({
      // ...options
    })
  ]
});
OptionTypeDefaultDescription
enabledbooleantrueDisable stats collection and report generation. This option is disabled automatically for vite dev mode
reportCompressedSizebooleantrueCalculate compressed size of chunks. May slightly increase build time.
reportDirectoryNamestring"bundle-report"Name of the output directory
emitHtmlbooleantrueGenerate a standalone interactive HTML report
emitJsonbooleanfalseGenerate raw stats.json file
checkbooleantrueRun report checks during the build process
failOnWarningbooleanfalseCancel build if bundle has any report warnings

CI/CD Integration

You can use vite-bundle-explorer to run checks in your CI pipeline.

To fail the build when duplicate dependencies or other warnings are found, set failOnWarning to true:

export default defineConfig({
  plugins: [
    statsPlugin({
      failOnWarning: true,
    }),
  ],
});

Keywords

vite

FAQs

Package last updated on 28 Nov 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