One of my feature modules has this content:
declare function require(name: string);
@NgModule({
imports: [
// other modules here
ChartModule.forRoot(
require('highcharts'),
require('highcharts/highcharts-more'),
require('highcharts/modules/funnel'),
require('highcharts/modules/heatmap')
)
It runs fine locally but when I build it with the prod flag it fails. The error I get is:
ERROR in Error encountered resolving symbol values statically. Reference to a non-exported function (position 26 :18 in the original .ts file), resolving symbol ....
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in ...
Any idea on how to resolve this?