Visualizes the import branch of an Angular production bundle built with the esbuild/Vite builder. Starting from index.html, it produces an interactive HTML tree showing chunk-to-chunk imports (eager + lazy routes) and per-chunk original module contents using the build's stats.json metafile. Unlike flat bundle analyzers, it understands Angular's two-tier loading model, showing what ships on first paint, what loads later via dynamic imports, and why a module is in a particular chunk. Current stable version: 0.5.0. Requires Node.js ≥ 22.6.0. Released as needed, open source under MIT.
npm install angular-esbuild-visualizerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to programmatically analyze an Angular bundle from stats.json and index.html, then generate a self-contained HTML report using the library's two main functions.
Update Node.js to v22.6.0 or later.
Ensure both files exist in the specified directory, or use --stats and --html flags to point to specific paths.
Enable statsJson in angular.json or use ng build --stats-json. Ensure the builder is set to application (esbuild).
Use --top with a positive integer, or omit it for the default.
Switch your project to ESM ("type": "module" in package.json) or use dynamic import: const { analyzeBundle } = await import('angular-esbuild-visualizer');Ensure you run ng build --stats-json with the application builder. Verify that stats.json contains 'inputs' and 'outputs' properties.
Run ng build --stats-json first, then pass the correct output directory (e.g., dist/my-app/browser).