ember-cli-bundle-analyzer
ember-cli-bundle-analyzer copied to clipboard
Refactor to use sourcemaps for analysis
This is basically an Ember CLI addon providing a middleware that wraps the existing analyzer functionality of https://github.com/stefanpenner/broccoli-concat-analyser, which itself is coupled to the stats output functionality of broccoli-concat. This comes with some problems:
- it currently does not work correctly with
ember-auto-import(https://github.com/stefanpenner/broccoli-concat-analyser/issues/34) - any modern new build/packager pipeline (aka embroider) will (assumingly/most likely) not use
broccoli-concatand thus make this cease to work at all!?
The only way forward I can think of is to make this work independently of the underlying bundler is by depending on sourcemaps only to analyze the bundle output. This could be implemented by making this basically a wrapper around https://github.com/danvk/source-map-explorer, eventually with a nicer (the current) frontend output.
Before I go down the rabbit hole here and invest some time, I would like to summon the experts in this field, namely @stefanpenner and @ef4, to share their thoughts, if time permits! 🙏😀
I think sourcemap approach makes sense, currently we do not have a "Fast, file only" sourcemap configuration for broccoli-concat, this results in either 1) slow high fidelity maps 2) no maps. Due to this, the original approach was taken.
That being said, It shouldn't be very hard to add "file only" sourcemaps to broccoli-concat. What i mean by "file only" is that, they do not care about the interior mappings of a file, merely the file boundaries when concat occurs.