Closed brettz9 closed 8 months ago
Is it possible to have the same code work as both (a module, and direct non-module inclusion in the browser)? Or is there an incompatible syntax?
They are unfortunately incompatible.
The ESM syntax for exporting, e.g.., export default X;
or export {x};
do not work for CJS or UMD.
Hmm, OK. Perhaps it could be in a separate .mjs
file then.
It smells a bit bad to have almost-identical files like that, but I'm unlikely to do much (if any) further development on this library unless there's a major bug, so it's probably not a big deal.
In that case, a PR would be welcome! If you might be interested, I'd be happy to add you as a contributor as well, to streamline any future changes you need.
Thanks! I've submitted #29 . It now generates the UMD file from the ESM file, so there is not the code smell I think. And yes, I'd be happy to be added as a contributor (looking to follow whatever procedures you would like for review).
Closed by #29.
Would you be open to a PR to add an ESM export (presumably changing source to ESM and then exporting also as UMD)?