diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-09-21 16:10:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-21 16:10:38 -0700 |
commit | 9be8dce0c7f8deaeff5523735e0867194ec04c59 (patch) | |
tree | 36977fc586cff680bb0847bdb19e586e0e777955 /tests/registry/npm/@denotest/mjs-reexport-cjs | |
parent | 4b022103a14916de1c3bc539d123273750138915 (diff) |
fix(node): Include "node" condition during CJS re-export analysis (#25785)
Fixes #25777.
We were missing the "node" condition, so we were resolving to the wrong
conditional export, causing our analysis to be incorrect.
Diffstat (limited to 'tests/registry/npm/@denotest/mjs-reexport-cjs')
4 files changed, 20 insertions, 0 deletions
diff --git a/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/dist/package.cjs.js b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/dist/package.cjs.js new file mode 100644 index 000000000..1d1499e2c --- /dev/null +++ b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/dist/package.cjs.js @@ -0,0 +1,7 @@ +Object.defineProperty(exports, '__esModule', { value: true }); + +const pkg = require("@denotest/conditional-exports-node"); + +Object.keys(pkg).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = pkg[k]; +});
\ No newline at end of file diff --git a/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/index.js b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/index.js new file mode 100644 index 000000000..9f407c0b1 --- /dev/null +++ b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/index.js @@ -0,0 +1 @@ +module.exports = require('./dist/package.cjs.js')
\ No newline at end of file diff --git a/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/index.mjs b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/index.mjs new file mode 100644 index 000000000..3767e9fcd --- /dev/null +++ b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/index.mjs @@ -0,0 +1 @@ +export * from "./index.js";
\ No newline at end of file diff --git a/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/package.json b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/package.json new file mode 100644 index 000000000..9a3ef3c84 --- /dev/null +++ b/tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/package.json @@ -0,0 +1,11 @@ +{ + "name": "@denotest/mjs-reexport-cjs", + "version": "1.0.0", + "dependencies": { + "@denotest/conditional-exports-node": "*" + }, + "exports": { + "node": "./index.mjs", + "default": "./index.js" + } +}
\ No newline at end of file |