kellyselden / ember-cli-tree-shaker

Experiment with tree-shaking in Ember CLI
MIT License
76 stars 7 forks source link

Support `include` in addons #15

Open offirgolan opened 6 years ago

offirgolan commented 6 years ago

@kellyselden this repo is a fantastic start in the right direction. Well done 👏 👏 👏 .

I'm not sure if you guys have already thought of this but it would be a lot more beneficial for addons to specify which files should be force included into the addon tree. In your example with ember-metrics, the app developer is required to know the structure of ember-metrics and which files are needed/dynamically imported which shouldnt really be the case.

Instead, there should me a new ember-cli hook in index.js to better support this which allows addon authors to generate the include collection. This would work hand in had with defined options in config/environment or ember-cli-build.js that addon consumers can specify (see ember-composable-helpers).

nightire commented 6 years ago

and before what @offirgolan suggested become a thing, this addon should provide an option to output the paths (or names for clearer) of all eliminated modules.

kellyselden commented 6 years ago

@nightire It does. It prints the dead modules to the console.

nightire commented 6 years ago

@kellyselden oh, yes, that's very helpful, thanks.