Open 0xdevalias opened 9 months ago
Even more tangentially related to this, I've pondered how much we could 're-construct' the files necessary to use tools like bundle analyzer, without having access to the original source (or if there would even be any benefit to trying to do so):
- https://github.com/webpack-contrib/webpack-bundle-analyzer
Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
- https://github.com/webpack-contrib/webpack-bundle-analyzer#usage-as-a-cli-utility
You can analyze an existing bundle if you have a webpack stats JSON file.
You can generate it using
BundleAnalyzerPlugin
withgenerateStatsFile
option set totrue
or with this simple command:webpack --profile --json > stats.json
- https://webpack.js.org/api/stats/
Stats Data When compiling source code with webpack, users can generate a JSON file containing statistics about modules. These statistics can be used to analyze an application's dependency graph as well as to optimize compilation speed.
- https://nextjs.org/docs/pages/building-your-application/optimizing/bundle-analyzer
My gut feel is that we probably can figure out most of what we need for it; we probably just can't give accurate sizes for the original pre-minified code, etc; and the module names/etc might not be mappable to their originals unless we have module identification type features (see https://github.com/pionxzh/wakaru/issues/41)
Originally posted by @0xdevalias in https://github.com/0xdevalias/chatgpt-source-watch/issues/9#issuecomment-1974432157
This is an idea I've had in passing a few times, but keep forgetting to document it:
I'm not 100% sure if this would be useful, or partially useful, but I think I am thinking of it tangentially in relation to things like: