natural icon indicating copy to clipboard operation
natural copied to clipboard

Bundle an ESM build of the module

Open alfaproject opened this issue 4 years ago • 7 comments

For better tree-shaking and to keep up with latest standards, it would be nice if this package was also published in ESM together with CommonJS for the time being. (:

alfaproject avatar Aug 28 '21 13:08 alfaproject

What does this mean for the current use of export and require statement. Should this be replaced? Is there a way to automate this and make it part of the building process (make it a github action)?

Hugo-ter-Doest avatar Nov 11 '21 09:11 Hugo-ter-Doest

I recommend that CommonJS modules should be phased out in favour of ES6 standards... this will allow support into Deno as well.

christopheragnus avatar Jul 17 '22 16:07 christopheragnus

Is there an update on this? Struggling to use Natural with Vite and it requires a polyfill to use Natural in the browser.

xn1cklas avatar Apr 24 '23 12:04 xn1cklas

Would love to see ES6 support

bthomas2622 avatar Apr 28 '23 22:04 bthomas2622

What does this mean for the current use of export and require statement. Should this be replaced? Is there a way to automate this and make it part of the building process (make it a github action)?

And can the two module systems be offered together?

Hugo-ter-Doest avatar Apr 30 '23 13:04 Hugo-ter-Doest

I was trying to get this working last night but I think, at least with the current setup in webpack, this isn't possible. Would have to swap to rollup or esbuild (unless I'm missing something). I'd be happy to help out on this. I'm wanting to use this package in Deno Deploy, but it doesn't support npm specifiers atm which is how this package works in Deno at all.

whaaaley avatar Jul 03 '23 01:07 whaaaley

See #744 for first concept of ESM build with rollup.

Hugo-ter-Doest avatar May 28 '24 19:05 Hugo-ter-Doest