Skip to content

Commit d9fa822

Browse files
authored
ESM: revisit removeGlobalNodeModuleLookupPaths (fix microsoft#226042) (microsoft#226603)
1 parent 46b8004 commit d9fa822

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/bootstrap-fork.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ performance.mark('code/fork/start');
2323
configureCrashReporter();
2424

2525
// Remove global paths from the node module lookup (node.js only)
26-
bootstrapNode.removeGlobalNodeModuleLookupPaths();
26+
bootstrapNode.removeGlobalNodeJsModuleLookupPaths();
2727

2828
// Enable ASAR in our forked processes
2929
bootstrapNode.enableASARSupport();

src/bootstrap-node.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,11 @@ module.exports.devInjectNodeModuleLookupPath = function (injectPath) {
110110
// ESM-comment-end
111111
};
112112

113-
module.exports.removeGlobalNodeModuleLookupPaths = function () {
113+
module.exports.removeGlobalNodeJsModuleLookupPaths = function () {
114114
if (typeof process?.versions?.electron === 'string') {
115115
return; // Electron disables global search paths in https://github.com/electron/electron/blob/3186c2f0efa92d275dc3d57b5a14a60ed3846b0e/shell/common/node_bindings.cc#L653
116116
}
117117

118-
// TODO@esm this might not work anymore (https://github.com/microsoft/vscode/issues/226042)
119-
120118
const Module = require('module');
121119
// @ts-ignore
122120
const globalPaths = Module.globalPaths;
@@ -273,7 +271,7 @@ module.exports.fileUriFromPath = function (path, config) {
273271

274272
// ESM-uncomment-begin
275273
// export const devInjectNodeModuleLookupPath = module.exports.devInjectNodeModuleLookupPath;
276-
// export const removeGlobalNodeModuleLookupPaths = module.exports.removeGlobalNodeModuleLookupPaths;
274+
// export const removeGlobalNodeJsModuleLookupPaths = module.exports.removeGlobalNodeJsModuleLookupPaths;
277275
// export const configurePortable = module.exports.configurePortable;
278276
// export const enableASARSupport = module.exports.enableASARSupport;
279277
// export const fileUriFromPath = module.exports.fileUriFromPath;

0 commit comments

Comments
 (0)