Can't use external npm module with rollup.js


#1

Rollup doesn’t let you build if using an npm module that doesn’t support AoT compiling, which seems to be all of the ones I try :wink:

ionic serve works because it’s not using AoT compiling.

This seems to be an issue with ngc in the ionic build script, here’s the error I get:

ngc: Error: Unexpected value 'DynamicComponentModule' imported by the module 'AppModule'

I’m using a normal import:

import {DynamicComponentModule} from 'angular2-dynamic-component/index';
@NgModule({
...
imports: [
IonicModule.forRoot(MyApp),
DynamicComponentModule
],
...

It might be related to this issue, not sure: https://github.com/rollup/rollup/issues/447

Does anyone have a solution for this, or know how to disable this feature in rollup so I can at least build for prod without errors?