Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CommonJS export #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add CommonJS export #3

wants to merge 1 commit into from

Conversation

sgwilym
Copy link

@sgwilym sgwilym commented Sep 7, 2022

Hello! I am using this dependency to help me build an isomorphic NPM module which has both ESM and CommonJS distributions. I wasn't able to do this without the addition of a CommonJS export to this package, which is currently ESM only.

  • Added index.node.cjs
  • Renamed index.node.js to index.node.mjs
  • Added import and require conditions to the node export in package.json
  • Changed package.json's main to point at the .cjs, and added a module key which points at the .mjs variant

@Swimburger
Copy link

Thank you for this PR. I went ahead and forked the repo and pulled in your PR to resolve an issue I had with using this with Jest. I hope this is merged into this repo too tho.

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