Hi, I'm starting a large application and want to break it up into reusable components. The application is angular 4 with angular-cli 1.0. The components are angular 4 with rollup as a bundler based on this article <https://www.codementor.io/stevebelovarich/use-rollup-to-build-angular-2-web-apps-du1089cq5> and it has a very basic my.component.ts and a my.module.ts.
Everything works fine when in development using *npm start*, importing my.module into the app's NgModule and consuming the my.component in the app's components and modules. But when trying to build and bundle the app for production with *ng build --prod* then I'm getting the error message: *Type my.component ... is part of the declaration of 2 modules...* which, yes, it is because my.component is imported into my.module and into the app's NgModule. I'm not sure why it doesn't complain when run in development with npm start. But if I remove it from NgModule then *ng build --prod *doesn't complain any more but then I can't run it in development with *npm start*! It's one or the other. Anyone have any idea why and what to do? Are there simple alternatives to bundling shared components for consumption in larger applications? An example would really make my day :-) -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
