Skip to content

Commit 36cd484

Browse files
committed
Move out main re-resolution
1 parent 4cf437c commit 36cd484

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/modules/run_main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ function shouldUseESMLoader(mainPath) {
7979
function runMainESM(mainPath) {
8080
const { loadESM } = require('internal/process/esm_loader');
8181
const { pathToFileURL } = require('internal/url');
82+
const main = pathToFileURL(mainPath).href;
8283

8384
handleMainPromise(loadESM((esmLoader) => {
84-
const main = path.isAbsolute(mainPath) ?
85-
pathToFileURL(mainPath).href : mainPath;
8685
return esmLoader.import(main, undefined, { __proto__: null });
8786
}));
8887
}

0 commit comments

Comments
 (0)