Skip to content

Conversation

2wheeh
Copy link

@2wheeh 2wheeh commented Aug 26, 2025

There are some open PRs for ESM support but apart from that it needs proper exports to be resolved by modern bundlers.

Once it supports dual format (esm, cjs), it just need to update like:

  "exports": {
    ".": {
      "types": "./index.d.ts",
      "import": "./index.mjs",
      "require": "./index.js"
    },
    "./*": {
      "types": "./*.d.ts",
      "import": "./*.mjs",
      "require": "./*.js"
    }
  },

Comment on lines +18 to +19
"main": "./index.js",
"types": "./index.d.ts",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields will be completely ignored once "exports" exists so they don't actually do anything.

Comment on lines +23 to +24
"import": "./index.js",
"require": "./index.js"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just put one line "default" here for now instead.

But this all conflicts with the PR for adding ESM support #104

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants