mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
module: lazy load 'getOptionValue' in initializeLoader
This enables loading this module during early bootstrapping. PR-URL: https://github.com/nodejs/node/pull/33212 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
committed by
Anna Henningsen
parent
280c485d36
commit
f153081d26
@@ -8,8 +8,6 @@ const { pathToFileURL } = require('internal/url');
|
||||
const {
|
||||
getModuleFromWrap,
|
||||
} = require('internal/vm/module');
|
||||
const { getOptionValue } = require('internal/options');
|
||||
const userLoader = getOptionValue('--experimental-loader');
|
||||
|
||||
exports.initializeImportMetaObject = function(wrap, meta) {
|
||||
const { callbackMap } = internalBinding('module_wrap');
|
||||
@@ -38,6 +36,8 @@ exports.ESMLoader = ESMLoader;
|
||||
|
||||
exports.initializeLoader = initializeLoader;
|
||||
async function initializeLoader() {
|
||||
const { getOptionValue } = require('internal/options');
|
||||
const userLoader = getOptionValue('--experimental-loader');
|
||||
if (!userLoader)
|
||||
return;
|
||||
let cwd;
|
||||
|
||||
Reference in New Issue
Block a user