Angular CLI repro
https://github.com/danbucholtz/angular-cli-duplicate-modules
Ionic repro
https://github.com/rapropos/ionic-lazy-sandbox
Basically, with a SharedModule imported by multiple NgModules, I see the same code in multiple chunks. This is not how Webpack is supposed to work.
Thanks,
Dan
Forum poster rlouie found angular-cli #2771, which looks highly relevant.
@rapropos,
Sorry, I forgot to follow up. I think this is working as designed right now. I'm not super pleased with that design but it is what it is for now. I reached out to angular-cli team and the webpack team to get the info.
Thanks,
Dan
Thanks for the update. May I just plead that if this doesn't get resolved, don't make lazy page loading mandatory? Going back to putting everything in a single app module is better for some situations. I accept that you're going to have to do what you have to do with generator boilerplate code, but just please let people continue to pass constructors to navigation controllers and bypass the deep linking magic.
Lazy loading was never and will never be mandatory. I agree with you. We are going to ship Ionic 3 not talk about lazy loading yet because we need to go back to the drawing board a bit. The tooling (aka Webpack and Uglify) is not working the way we or the angular team expected so we need to think our recommendations through a bit more.
Thanks,
Dan
Most helpful comment
Lazy loading was never and will never be mandatory. I agree with you. We are going to ship Ionic 3 not talk about lazy loading yet because we need to go back to the drawing board a bit. The tooling (aka Webpack and Uglify) is not working the way we or the angular team expected so we need to think our recommendations through a bit more.
Thanks,
Dan