I have an Angular project with several feature modules but I'm not sure what's the best practice for structuring shared modules.
- Is it considered best to have one large
SharedModule
imported in each feature module even if it contains components, pipes, directives, etc. that are used only in a few but not all feature modules? - Or is it better to split them up into smaller modules (logical units) and import them one by one to feature modules only where they're needed?
I think that (1) sounds a lot easier to write but I'm somewhat concerned that importing partly unused code into each feature module may slow down my application and make lazy-loading somewhat pointless. If somebody can shed light on the advantages and disadvantages of both strategies, that would be very welcome. Thanks!