I'm using a map library that exports polygon definition as:
export default {
...
}
in various files like world.ts for example.
I then utilise the data in my Angular component using:
import mapData from '@amcharts/amcharts4-geodata/world';
It all works well when running ng serve
but the data does not simply pass through when the build has been run.
Upon reading the limitations of AOT, the default exports are not supported; though it has been rectified in Angular 9.
Is there some configuration in angular.json
or a way I can import the data in the build? I run Angular 8.
Make sure that --build-optimizer=false
is set in your config as mentioned in AmCharts' Angular Integration tutorial. This is due to a bug in their build optmizer as mentioned in this issue; this comment links to several similar complaints about the build-optimizer breaking third party code.