streamich / fs-monkey

Monkey-patches for file system related things
The Unlicense
112 stars 19 forks source link

fix: look for `exports.require` in `package.json` in addition to `main` when patching `require` #378

Closed dylannil closed 1 year ago

dylannil commented 1 year ago

ENV:

PACKAGE.JSON PART:

{
  "main": "dist/tiny-lru",
  "exports": {
    "types": "./lru.d.ts",
    "import": "./dist/tiny-lru.js",
    "require": "./dist/tiny-lru.cjs"
  },
}

the main field is an ESModule,require need exports.require data to load module in CommonJS.

Resolves #378

dylannil commented 1 year ago

@G-Rath would you review this PR?

G-Rath commented 1 year ago

We're not able to do releases until @streamich updates the npm token per #381 - note though you shouldn't be updating the version in package.json in your PR.

dylannil commented 1 year ago

@G-Rath Change in package.json version has been reverted.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.0.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: