gentooboontoo / js-quantities

JavaScript library for quantity calculation and unit conversion
http://gentooboontoo.github.io/js-quantities/
MIT License
396 stars 102 forks source link

Can't import the ES module in Angular #142

Open ozkoidi opened 10 months ago

ozkoidi commented 10 months ago

Hello,

I'm trying to import the ES module version of the library in an Angular 15 project and I get the following error:

image

I see that there is an export in package.json but it doesn't seem to work.

Aditional info: I installed the dependency "js-quantities": "^1.8.0" and the devDependency @types/js-quantities": "^1.6.3"

gentooboontoo commented 10 months ago

Hi. Could you try import Qty from 'js-quantities';?

ozkoidi commented 10 months ago

Yes, that works but it doesn't use the ES module version right? Which is the one I'm trying to use

godind commented 8 months ago

Same here!

godind commented 8 months ago

To add more valuable context: using import Qty from 'js-quantities'; works fine but I get the following...obvious I guess!

Warning: /.../.service.ts depends on 'js-quantities'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies