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

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

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

dylannil
Copy link
Contributor

@dylannil dylannil commented Jul 28, 2023

ENV:

  • run by nodejs
  • memfs + unionfs
  • require('tiny-lru')

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 dylannil changed the title require from patchRequire can now read exports.require info from package.json fix: require from patchRequire can now read exports.require info from package.json Jul 28, 2023
@dylannil
Copy link
Contributor Author

@G-Rath would you review this PR?

@G-Rath
Copy link
Collaborator

G-Rath commented Sep 20, 2023

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
Copy link
Contributor Author

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

@G-Rath G-Rath changed the title fix: require from patchRequire can now read exports.require info from package.json fix: look for exports.require in package.json in addition to main when patching require Sep 25, 2023
@G-Rath G-Rath merged commit 411b791 into streamich:master Sep 25, 2023
9 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 25, 2023
## [1.0.5](v1.0.4...v1.0.5) (2023-09-25)

### Bug Fixes

* look for `exports.require` in `package.json` in addition to `main` when patching `require` ([#378](#378)) ([411b791](411b791))
@github-actions
Copy link

🎉 This PR is included in version 1.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants