Open AlexElin opened 1 year ago
Let me dive into the problem. :)
I suppose the module
property in tsconfig.json should be changed from commonjs
to at least ES2015
.
That's true.
But then other consumers cannot do require('type-comparator')
. Just tested....
Even node-fetch
made a major release to support ESM...
Not sure it's right direction... But may be someone help me to find a way to support both CJS and ESM 😄
@AlexElin I hope this link will help you https://angular.io/guide/build#configuring-commonjs-dependencies
for me it works
@vasaeps3 In effect it's just ignoring the warning (suppressing it). In my opinion a correct solution would be providing ESM modules.
There're a several ways to do this:
When a class in Angular app uses types from the library, Angular prints the following warning while executing
ng build
.Versions Angular: v14+ (I've not checked on earlier ones). type-comparator: 0.2.9