Does importing Angular Material modules in multiple lazy-loaded modules cause duplication in...

Discussão em 'Angular' iniciado por Shank, Abril 14, 2025.

  1. Shank

    Shank Guest

    I’m using Angular with lazy-loaded modules, and I’ve noticed that each feature module imports some Angular Material modules (like MatButtonModule, MatToolbarModule, etc.).

    My question is: Does this practice cause these modules (Material modules) to be duplicated in the final production build? Or does Angular’s build process (Webpack, tree-shaking) deduplicate these shared modules automatically, even though they're imported in multiple lazy-loaded modules?

    I'm not able to find much on Angular's page, is the a source link that supports either of the claim?

    Continue reading...

Compartilhe esta Página