Skip to content

Navigation Menu

Sign in
Sign up

ESM module support #133

Open
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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /