ruimarinho / google-libphonenumber

The up-to-date and reliable Google's libphonenumber package for node.js.
https://ruimarinho.github.io/google-libphonenumber
Other
1.4k stars 146 forks source link

CommonJS modules #353

Open StaysenseWesMelton opened 1 year ago

StaysenseWesMelton commented 1 year ago

Any chance you could update the build process to export modules so TS apps can use this library without importing the entire library before doing destructuring?

riderx commented 1 year ago

i got this message if that can help

[ng] Warning: ./node_modules/@capgo/ngx-intl-tel-input/fesm2020/capgo-ngx-intl-tel-input.mjs depends on 'google-libphonenumber'. CommonJS or AMD dependencies can cause optimization bailouts.
[ng] For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
[ 

So for me even splitted lib could be better

ruimarinho commented 1 year ago

I'm all for it but I don't really have the time to do it at the moment. If anyone is interested in doing a PR, I'll be glad to take a look.

I think the real difficulty here is the dependency on Google Closure though. If Google moved away from it, it would be so much easier to use the upstream version..