A CLI tool (v1.4.0, active development) that analyzes lazy-loading in esbuild chunk splits using the metafile output. It generates static JSON statistics and interactive HTML dependency graphs showing chunk composition, eager vs lazy imports per entry point, length of dependency chains, and file-level bundle impact. Unlike general esbuild visualizers (e.g., esbuild-visualizer), this focuses on code-splitting optimization, showing which chunks are lazy-loaded and their sizes, enabling developers to identify opportunities for improved lazy-loading. It produces a self-contained HTML report with interactive import graphs and modals for per-file import inspection.
npm install esbuild-lazy-analyzerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generate an esbuild metafile and run the analyzer to produce an interactive HTML report.
Ensure esbuild run with --splitting flag: npx esbuild ... --splitting
Add --outmeta path.json or --outreport path.html (or both).
Use a local server (e.g., npx serve .) to open the report.
Verify the path and re-run esbuild with --metafile to create the metafile.
Run esbuild with --splitting and --format=esm to generate multiple chunks.
No dependency data recorded yet.