Skip to content

Commit

Permalink
do not force ESM loader when --experimental-loader is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
srolel committed Jun 28, 2020
1 parent 34a0f30 commit 69a29ee
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/internal/modules/run_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ function resolveMainPath(main) {
}

function shouldUseESMLoader(mainPath) {
const userLoader = getOptionValue('--experimental-loader');
if (userLoader)
return true;
const esModuleSpecifierResolution =
getOptionValue('--es-module-specifier-resolution');
if (esModuleSpecifierResolution === 'node')
Expand All @@ -41,7 +38,7 @@ function runMainESM(mainPath) {
const esmLoader = require('internal/process/esm_loader');
const { pathToFileURL } = require('internal/url');
const { hasUncaughtExceptionCaptureCallback } =
require('internal/process/execution');
require('internal/process/execution');
return esmLoader.initializeLoader().then(() => {
const main = path.isAbsolute(mainPath) ?
pathToFileURL(mainPath).href : mainPath;
Expand Down

0 comments on commit 69a29ee

Please sign in to comment.