-
Notifications
You must be signed in to change notification settings - Fork 24
ESM module support #133
Copy link
Copy link
Open
Description
One thing I have noticed is the main export is a commonJS module, hence the examples "require", but this is not idomatic cloudflare worker. Cloudflare workers can support commonJS via their internal workaround https://blog.cloudflare.com/workers-javascript-modules/ but it is not its primary module mechanism, that is ESM.
As I hate breaking backwards compatibility, we can support both by exporting two different packages https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html but I would suggest changing examples to ESM going forward. Of coure, both should be supported in integration tests so we never accidentally regress (see #130)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels