edn-data icon indicating copy to clipboard operation
edn-data copied to clipboard

Use as ES6 module in browser?

Open borkdude opened this issue 6 months ago • 2 comments

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?

borkdude avatar Dec 11 '23 19:12 borkdude

Hi @borkdude :wave: That sounds useful! Makes me happy to see this library being used :slightly_smiling_face: 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 :blush:

jorinvo avatar Dec 12 '23 07:12 jorinvo

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

borkdude avatar Dec 12 '23 16:12 borkdude