I try to ajust my angular app to be ready for AOT compilation and Tree Shaking (rollup). But I have problems by using modules which have no default exports (immutable.js, moment.js, ...). According to typscript (look here) it is only possible to use such modules with the following statement: import x = require('x')
or import * as x from 'x'
But both statements cause problems during the rollup. In some cases I get an error during the rollup: Cannot call a namespace ('x')
and in some cases I get an runtime error that: x is undefined
Here you find my rollup-config.js and tsconfig-aot.json tsconfig-aot_rollup-config.zip
I need a way to use packages like immutable.js, moment.js during the AOT compilation and rollup. Is there a way to do this?
Thanks!