simonihmig / ember-cli-bundle-analyzer

Analyze the size and contents of your Ember app's bundles
MIT License
99 stars 2 forks source link

Refactor to use sourcemaps for analysis #24

Closed simonihmig closed 1 year ago

simonihmig commented 5 years ago

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:

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! 🙏😀

stefanpenner commented 5 years ago

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.