{"id":25294,"library":"esbuild-lazy-analyzer","title":"esbuild-lazy-analyzer","description":"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.","status":"active","version":"1.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/alexanderdombroski/esbuild-lazy-analyzer","tags":["javascript"],"install":[{"cmd":"npm install esbuild-lazy-analyzer","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-lazy-analyzer","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-lazy-analyzer","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Tool is a CLI, not a library. Use npx or install globally and run directly. No JavaScript API is exported.","wrong":"npm run esbuild-lazy-analyzer","symbol":"esbuild-lazy-analyzer","correct":"npx esbuild-lazy-analyzer --metafile meta.json --outreport report.html"}],"quickstart":{"code":"// Build with esbuild and output metafile\nnpx esbuild src/index.js --bundle --splitting --format=esm --outdir=dist --metafile=meta.json\n\n// Analyze lazy-loading\nnpx esbuild-lazy-analyzer --metafile meta.json --outreport report.html\n\n// Open report.html in browser\n","lang":"javascript","description":"Generate an esbuild metafile and run the analyzer to produce an interactive HTML report."},"warnings":[{"fix":"Ensure esbuild run with --splitting flag: npx esbuild ... --splitting","message":"The --metafile must be produced with esbuild's splitting enabled; otherwise, there is only one chunk and analysis is trivial.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add --outmeta path.json or --outreport path.html (or both).","message":"At least one of --outmeta or --outreport is required; the tool will error if neither is provided.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a local server (e.g., npx serve .) to open the report.","message":"The tool generates HTML with relative imports for D3; the report must be served via HTTP (not file://) to display graphs correctly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Verify the path and re-run esbuild with --metafile to create the metafile.","cause":"The --metafile path is incorrect or the file wasn't generated.","error":"Error: The specified metafile does not exist."},{"fix":"Run esbuild with --splitting and --format=esm to generate multiple chunks.","cause":"The metafile is valid but doesn't contain output chunks (e.g., splitting not enabled).","error":"Error: No data found in the metafile's outputs."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}