Open fabiospampinato opened 1 year ago
I agree. I think it makes the most sense for this to also be a part of esbuild's dev server eventually.
Where does the source for the visualizer currently live?
@retorquere See https://github.com/evanw/esbuild/issues/2926
I've written a little CLI thing that basically implements this for quickly inspecting NPM packages: https://github.com/fabiospampinato/banal
This would be great to have, for instance to host on GitHub Pages for every PR, or even to have a simple link with the metafile's content in the URL to be able to open the "official" analyzer with the proper data in just one click. I've already started working on a GitHub action to add PR comments to summarize changes (similar to esbuild-bundle-analyzer), but nothing beats the official analyzer for a deeper dive!
I second. Would be great to have something that works with Angular 18.
I've written a little CLI thing that basically implements this for quickly inspecting NPM packages: https://github.com/fabiospampinato/banal
What if I want to inspect my own site? Including node modules if they are referenced? Basically the final bundle.
What if I want to inspect my own site? Including node modules if they are referenced? Basically the final bundle.
@vzakharov-rxnt npx banal ./path/to/whereever.js
if you want a bundle analysis for a local thing. If that doesn't work for you (maybe you need custom plugins to bundle it?) please open an issue here.
@fabiospampinato I want to analyze the whole project. Specifying path to main.js file does not work. Tech is Angular.
@vzakharov-rxnt,
@angular-devkit/build-angular:application
builder so that esbuild is usedng build --configuration=production --stats-json
npx banal --metafile=dist/your-app/stats.json
FYI https://www.npmjs.com/package/esbuild-visualizer does a decent job visualizing things. not as good as webpack-bundle-analyzer but better than website (quick glance) and most importanly local.
my usage from NX for angular app:
"size": "nx build --configuration=production --stats-json",
"display": "npx esbuild-visualizer --metadata=dist/myngapp/stats.json --open=true"
IMO the bundle analyzer should be self-hosted, and not reliant on a website, for a bunch of reasons:
webpack-bundle-analyzer
,rollup-plugin-visualizer
) have the above capabilities, so it would be nice to close the gap.