Tree-shaking in Angular Lazy Modules

58 Views Asked by At

I can't really get why are services, that are marked with providedIn:root and that are used only in lazy-loaded modules aren't tree shaked. We don't have our lazy modules in initial bundle but have services that are used in them, why? And how does angular even include them in the bundle if the module file only being downloaded when loaded with loadChildren?

0

There are 0 best solutions below