mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 12:34:32 +08:00
Webpack relies on package managers to do module hoisting and doesn't have any deduping logic since version 4. However relaying on package manager has a number of short comings, such as when having the same library with the same version laid out in different parts of the node_modules tree. Example: ``` /node_modules/tslib@2.0.0 /node_modules/library-1/node_modules/tslib@1.0.0 /node_modules/library-2/node_modules/tslib@1.0.0 ``` In the above case, in the final bundle we'll end up with 3 versions of tslib instead of 2, even though 2 of the modules are identical. Webpack has an open issue for this https://github.com/webpack/webpack/issues/5593 (Duplicate modules - NOT solvable by `npm dedupe`) With this change we add a custom resolve plugin that dedupes modules with the same name and versions that are laid out in different parts of the node_modules tree.
Angular Webpack Build Facade
WIP