angular-cesium
angular-cesium copied to clipboard
Remove warning from angular 10 compilation
In Angular 10, when compiling the project those warning appears :
WARNING in C:\Users\****\Documents\Repository\****\node_modules\angular-cesium\__ivy_ngcc__\fesm2015\angular-cesium.js depends on 'geodesy'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
WARNING in C:\Users\****\Documents\Repository\****\node_modules\angular-cesium\__ivy_ngcc__\fesm2015\angular-cesium.js depends on 'util'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
I believe this could be avoided by changing library/way of import
I agree, the link in the warnings shows you how to hide the warnings(https://angular.io/guide/build#configuring-commonjs-dependencies).
It recommends using a "ECMAScript modules" instead of the commonjs not sure what complications are with updating the following https://github.com/articodeltd/angular-cesium/blob/master/projects/angular-cesium/tsconfig.schematics.json#L9
"module": "commonjs",
to
"module": "es2020",
It would be nice to optimize this section of the code.
actually looking at it a little more it looks like there are dependencies on 'geodesy' and 'util'. Which I was slow to realize was the cause of it.
here is the snippet to add if you want to disable the build warnings in the angular.json options
"options": {
"allowedCommonJsDependencies":[
"geodesy",
"util"
]
}