New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export as es module #74
Comments
I'm not sure I follow; what makes this not work in a browser today? Using import should work just fine (at least if using a bundler like webpack). The export should work in both cases. Or do you mean without a bundler altogether? |
Regardless @tlouisse, feel free to make a PR and let me have a look |
Hi, thanks for the reply. I mean without a bundler indeed. I want to use it inside a web component (an input that validates/formats phone numbers). This web component is shipped as its own package and should be able to work without a "build step". You can expect a pull request in the coming weeks when I'm picking this up again 👍 |
@tlouisse hi, any update on that? |
Hi, I will try to look into it in the coming days :) |
@grantila any update on this? |
I had the idea of changing the API while doing this, and everything ended up a lot more complicated, e.g. rollup didn't handle named exports well (from the closure-compiled output). But it's all finally working well, thanks for the work on this! |
For reference of the API change; the |
🎉 This issue has been resolved in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Nice! Thanks a lot @grantila |
Hi,
Thanks for making this great package. It seems to be better than the original
google-libphonenumber
, both in terms of performance and developer experience.What I was wondering, would it be possible to add an esm output that allows for running this inside the browser as well?
If appreciated, I could do a PR for this. I have a local version running of this, that could be added to the current gulp task.
The build output could then be added as an export map:
In this way, I could use it in a browser context as:
and for NodeJS/commonjs it would stay as is:
The text was updated successfully, but these errors were encountered: