Registry / devops / esbuild-bundle-analyzer

esbuild-bundle-analyzer

JSON →
library0.0.1jsnpmunverified

A tool to analyze the size and composition of esbuild output bundles, helping identify optimization opportunities. Version 0.0.1 is extremely early and unstable — expect breaking changes with every release. Unlike bundle analyzers for Webpack (webpack-bundle-analyzer) or Rollup (rollup-plugin-visualizer), this is native to esbuild's plugin system, but currently lacks interactive visualizations and detailed module trees. Release cadence is not established.

npm install esbuild-bundle-analyzer
INSTALL
IMPORT
SIG · ESBUILD-BUNDLE-ANA
E
esbuild-bundle-analyzer
devopsjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

bundleAnalyzer
import { bundleAnalyzer } from 'esbuild-bundle-analyzer'
const bundleAnalyzer = require('esbuild-bundle-analyzer')
ESM-only. No CJS support.
default
import bundleAnalyzer from 'esbuild-bundle-analyzer'
Default export aliases the named export. Avoid as it may be removed.
BundleAnalyzerPlugin
import { BundleAnalyzerPlugin } from 'esbuild-bundle-analyzer'
Internal class name, not public API. Unlikely to work.
type Options
import type { Options } from 'esbuild-bundle-analyzer'
Utility type for plugin options.

Shows how to add the bundle analyzer as an esbuild plugin to generate a report JSON file during build.

import * as esbuild from 'esbuild'; import { bundleAnalyzer } from 'esbuild-bundle-analyzer'; await esbuild.build({ entryPoints: ['app.js'], bundle: true, outfile: 'out.js', plugins: [bundleAnalyzer({ outfile: 'report.json', verbose: false })], }); console.log('Bundle analysis written to report.json');
Debug
Known issues
breakingAPI is unstable: plugin may not work with esbuild versions outside 0.0.1 range.
fix
Pin esbuild version to exact match; await stable releases.
affects: >=0.0.1 <0.1.0
deprecatedDefault export may be removed in future releases.
fix
Use named export { bundleAnalyzer } instead.
affects: >=0.0.1
gotchaPlugin does not support esbuild's watch mode properly; analysis may not update on rebuild.
fix
Restart build every time for accurate results.
affects: >=0.0.1
gotchaLarge bundles (>10MB) may cause out-of-memory errors.
fix
Analyze subsets of the bundle or increase Node memory limit (--max-old-space-size).
affects: >=0.0.1
gotchaOnly analyzes JavaScript/TypeScript files; CSS, images, and other assets are ignored.
fix
Use separate tools for non-JS assets.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-bundle-analyzer'
Package not installed or import path incorrect.
fix
Run 'npm install esbuild-bundle-analyzer@0.0.1' and verify import statement.
TypeError: bundleAnalyzer is not a function
Importing as CJS require instead of ESM import.
fix
Use 'import { bundleAnalyzer } from "esbuild-bundle-analyzer"' in an ESM context.
Error: The plugin must be a function or object with 'name' property.
Incorrect plugin instantiation: passing function directly without calling it.
fix
Use 'plugins: [bundleAnalyzer()]' (call the function) instead of 'plugins: [bundleAnalyzer]'.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-bundle-analyzer — npm install esbuild-bundle-analyzer · libregistry