diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/modules/run_main.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js index 1061727c78..5f8b1f53d3 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -24,6 +24,10 @@ function shouldUseESMLoader(mainPath) { const userLoader = getOptionValue('--experimental-loader'); if (userLoader) return true; + const esModuleSpecifierResolution = + getOptionValue('--es-module-specifier-resolution'); + if (esModuleSpecifierResolution === 'node') + return true; // Determine the module format of the main if (mainPath && mainPath.endsWith('.mjs')) return true; |