I have a lot of angular modules that are reused in the entire application, e.g.
- I18nModule
- StringInputModule
- ...
After building the app via angular CLI and inspecting the bundle with webpack bundle analyzer, these shared modules pop up in different modules that include them. Is there a way to force them into the common chunk instead? Or what are possible mistakes that can result into this behaviour of code duplication instead of detecting that it is indeed a shared module.
To clarify: the common chunk exists, but only a handfull of ~ 50 shared modules are actually bundled within that chunk. The rest is either duplicated across different feature chunks or a lot of them are within the first feature page module.
AoT is enabled, so is the commonChunk option (https://angular.io/cli/build)