-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
Bug Report or Feature Request (mark with an x)
- [ ] bug report -> please search issues before submitting
- [x] feature request
Desired functionality.
Here's a fairly common scenario: I have an application which has two feature modules that each depend on chart.js. Last time I checked with webpack-bundle-analyzer, angular-cli included the full chart.js library in each of the two feature modules.
The more general case is that feature modules (FM) may want to share another module between another, e.g. I have FM A and FM B and both access an angular module X. However, FM C and FM D do not depend on X. It would be awesome if angular-cli could figure that out from the module declarations/imports and then ensure that module X is loaded the first time either FM A or FM B is loaded. Of course, this would require that X be put in its own bundle/chunk.
Mention any other details that might be useful.
I've just stumbled over an article indicating that webpack should support such a scenario with the commonschunk plugin:
https://medium.com/webpack/webpack-bits-getting-the-most-out-of-the-commonschunkplugin-ab389e5f318