Skip to content
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

Use as ES6 module in browser? #22

Open
borkdude opened this issue Dec 11, 2023 · 2 comments
Open

Use as ES6 module in browser? #22

borkdude opened this issue Dec 11, 2023 · 2 comments

Comments

@borkdude
Copy link

I'd like to use this library in the squint playground. It seems I'm only able to do this via esm.sh:

example

The esm.sh service rewrites all the module.exports + require stuff to proper ES6 modules.
Would it be an idea to publish ES6 modules directly, such that this can be used from unpkg.com etc?

@jorinvo
Copy link
Owner

jorinvo commented Dec 12, 2023

Hi @borkdude 👋
That sounds useful! Makes me happy to see this library being used 🙂
I haven't worked with ES6 modules before. What do we have to change to make them work? Any hints how to do that are very welcome. I suppose it's possible to support ES6 modules while also keep supporting Node.js and Typescript, right? If it's easier for you to just open a PR, you are also more than welcome 😊

@borkdude
Copy link
Author

I'll have a look later, just dropping this link as a note for now:

https://dev.to/a0viedo/nodejs-typescript-and-esm-it-doesnt-have-to-be-painful-438e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants