Skip to content

Commit eda6039

Browse files
committed
fix botched merge
1 parent 944a08e commit eda6039

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dist-raw/node-esm-resolve-implementation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,8 @@ function finalizeResolution(resolved, base) {
347347
resolved.pathname, 'must not include encoded "/" or "\\" characters',
348348
fileURLToPath(base));
349349

350-
const file = resolveReplacementExtensions(resolved) || resolved;
351-
352-
const path = fileURLToPath(file);
353-
354350
if (getOptionValue('--experimental-specifier-resolution') === 'node') {
351+
const path = fileURLToPath(resolved);
355352
let file = resolveExtensionsWithTryExactName(resolved);
356353
if (file !== undefined) return file;
357354
if (!StringPrototypeEndsWith(path, '/')) {
@@ -364,6 +361,9 @@ function finalizeResolution(resolved, base) {
364361
resolved.pathname, fileURLToPath(base), 'module');
365362
}
366363

364+
const file = resolveReplacementExtensions(resolved) || resolved;
365+
const path = fileURLToPath(file);
366+
367367
const stats = tryStatSync(StringPrototypeEndsWith(path, '/') ?
368368
StringPrototypeSlice(path, -1) : path);
369369
if (stats.isDirectory()) {
@@ -375,7 +375,7 @@ function finalizeResolution(resolved, base) {
375375
path || resolved.pathname, fileURLToPath(base), 'module');
376376
}
377377

378-
return resolved;
378+
return file;
379379
}
380380

381381
function throwImportNotDefined(specifier, packageJSONUrl, base) {

0 commit comments

Comments
 (0)