* Define the conditions that apply to the CommonJS loader. * @returns {void}
()
| 77 | * @returns {void} |
| 78 | */ |
| 79 | function initializeCjsConditions() { |
| 80 | const userConditions = getOptionValue('--conditions'); |
| 81 | const noAddons = getOptionValue('--no-addons'); |
| 82 | const addonConditions = noAddons ? [] : ['node-addons']; |
| 83 | // TODO: Use this set when resolving pkg#exports conditions in loader.js. |
| 84 | cjsConditionsArray = [ |
| 85 | 'require', |
| 86 | 'node', |
| 87 | ...addonConditions, |
| 88 | ...userConditions, |
| 89 | ]; |
| 90 | if (getOptionValue('--require-module')) { |
| 91 | cjsConditionsArray.push('module-sync'); |
| 92 | } |
| 93 | ObjectFreeze(cjsConditionsArray); |
| 94 | cjsConditions = new SafeSet(cjsConditionsArray); |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Get the conditions that apply to the CommonJS loader. |
no test coverage detected
searching dependent graphs…