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
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.
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.
index.node.cjs
index.node.js
toindex.node.mjs
import
andrequire
conditions to thenode
export inpackage.json
main
to point at the.cjs
, and added amodule
key which points at the.mjs
variant