Skip to content

Commit

Permalink
fixup! module: unflag --experimental-require-module
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Sep 25, 2024
1 parent 759ec1f commit d79208a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/internal/modules/esm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,15 @@ function initializeDefaultConditions() {
const userConditions = getOptionValue('--conditions');
const noAddons = getOptionValue('--no-addons');
const addonConditions = noAddons ? [] : ['node-addons'];

const moduleConditions = getOptionValue('--experimental-require-module') ? ['module-sync'] : [];
defaultConditions = ObjectFreeze([
'node',
'import',
...moduleConditions,
...addonConditions,
...userConditions,
]);
defaultConditionsSet = new SafeSet(defaultConditions);
if (getOptionValue('--experimental-require-module')) {
defaultConditionsSet.add('module-sync');
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export async function resolve(specifier, context, defaultResolve) {

deepStrictEqual([...context.conditions].sort(), [
'import',
'module-sync',
'node',
'node-addons',
]);
Expand Down

0 comments on commit d79208a

Please sign in to comment.