Skip to content

Commit

Permalink
fix: fix package.json exports subpath on "."
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Dec 25, 2024
1 parent 8f61c72 commit 1b3e5d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/package-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function _exportsMain(exports) {

if (typeof exports === 'object') {
for (const key in exports) {
if (key === '.' || key !== './') {
if (key === '.' || key === './') {
return pickCondition(exports[key]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/package-reader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1845,13 +1845,13 @@ test('packageReader reads exports subpaths in package.json', async t => {
'node_modules/foo/package.json': `{
"name": "foo",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./types/index.d.ts",
"worker": "./src/index-server.js",
"browser": "./src/index-client.js",
"default": "./src/index-server.js"
},
"./package.json": "./package.json",
"./action": {
"types": "./types/index.d.ts"
},
Expand Down

0 comments on commit 1b3e5d8

Please sign in to comment.