Skip to content

Commit 27b814c

Browse files
himself65codebytere
authored andcommitted
module: lazy load 'getOptionValue' in initializeLoader
This enables loading this module during early bootstrapping. PR-URL: #33212 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 5b42d81 commit 27b814c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/process/esm_loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const { pathToFileURL } = require('internal/url');
88
const {
99
getModuleFromWrap,
1010
} = require('internal/vm/module');
11-
const { getOptionValue } = require('internal/options');
12-
const userLoader = getOptionValue('--experimental-loader');
1311

1412
exports.initializeImportMetaObject = function(wrap, meta) {
1513
const { callbackMap } = internalBinding('module_wrap');
@@ -38,6 +36,8 @@ exports.ESMLoader = ESMLoader;
3836

3937
exports.initializeLoader = initializeLoader;
4038
async function initializeLoader() {
39+
const { getOptionValue } = require('internal/options');
40+
const userLoader = getOptionValue('--experimental-loader');
4141
if (!userLoader)
4242
return;
4343
let cwd;

0 commit comments

Comments
 (0)