Skip to content

Commit afcd626

Browse files
committed
load description file after resolving with exports or imports field
fixes webpack/webpack#11750
1 parent 53860b2 commit afcd626

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

lib/ResolverFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ exports.createResolver = function (options) {
377377
"internal",
378378
conditionNames,
379379
importsField,
380-
"described-relative",
380+
"relative",
381381
"internal-resolve"
382382
)
383383
);
@@ -444,7 +444,7 @@ exports.createResolver = function (options) {
444444
"resolve-in-package",
445445
conditionNames,
446446
exportsField,
447-
"described-relative"
447+
"relative"
448448
)
449449
);
450450
});

test/exportsField.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,10 +1767,12 @@ describe("ExportsFieldPlugin", () => {
17671767
" existing directory .../node_modules/exports-field",
17681768
" using description file: .../node_modules/exports-field/package.json (relative path: .)",
17691769
" using exports field: ./lib/lib2/browser.js",
1770-
" .../node_modules/exports-field/lib/lib2/browser.js doesn't exist",
1770+
" using description file: .../node_modules/exports-field/package.json (relative path: ./lib/lib2/browser.js)",
1771+
" .../node_modules/exports-field/lib/lib2/browser.js doesn't exist",
17711772
" using exports field: ./lib/browser.js",
1772-
" existing file: .../node_modules/exports-field/lib/browser.js",
1773-
" reporting result .../node_modules/exports-field/lib/browser.js"
1773+
" using description file: .../node_modules/exports-field/package.json (relative path: ./lib/browser.js)",
1774+
" existing file: .../node_modules/exports-field/lib/browser.js",
1775+
" reporting result .../node_modules/exports-field/lib/browser.js"
17741776
]);
17751777
done();
17761778
}

test/importsField.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,16 +1325,18 @@ describe("ImportsFieldPlugin", () => {
13251325
" existing directory .../node_modules/a",
13261326
" using description file: .../node_modules/a/package.json (relative path: .)",
13271327
" using exports field: ./lib/lib2/index.js",
1328-
" no extension",
1329-
" .../node_modules/a/lib/lib2/index.js doesn't exist",
1330-
" .js",
1331-
" .../node_modules/a/lib/lib2/index.js.js doesn't exist",
1332-
" as directory",
1333-
" .../node_modules/a/lib/lib2/index.js doesn't exist",
1328+
" using description file: .../node_modules/a/package.json (relative path: ./lib/lib2/index.js)",
1329+
" no extension",
1330+
" .../node_modules/a/lib/lib2/index.js doesn't exist",
1331+
" .js",
1332+
" .../node_modules/a/lib/lib2/index.js.js doesn't exist",
1333+
" as directory",
1334+
" .../node_modules/a/lib/lib2/index.js doesn't exist",
13341335
" using exports field: ./lib/index.js",
1335-
" no extension",
1336-
" existing file: .../node_modules/a/lib/index.js",
1337-
" reporting result .../node_modules/a/lib/index.js"
1336+
" using description file: .../node_modules/a/package.json (relative path: ./lib/index.js)",
1337+
" no extension",
1338+
" existing file: .../node_modules/a/lib/index.js",
1339+
" reporting result .../node_modules/a/lib/index.js"
13381340
]);
13391341
done();
13401342
}

0 commit comments

Comments
 (0)