* add global for node_modules access

* remove most usages of require.__$__nodeRequire
* stop using require.nodeRequire
This commit is contained in:
Johannes
2022-11-17 12:09:14 +01:00
parent f675b2bfab
commit 0824db3bad
12 changed files with 82 additions and 12 deletions

11
src/bootstrap-fork.js vendored
View File

@@ -37,6 +37,17 @@ if (process.env['VSCODE_PARENT_PID']) {
terminateWhenParentTerminates();
}
// VSCODE_GLOBALS: node_modules
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), {
get(target, mod) {
if (!target[mod] && typeof mod === 'string') {
target[mod] = require(mod);
}
return target[mod];
}
});
// Load AMD entry point
require('./bootstrap-amd').load(process.env['VSCODE_AMD_ENTRYPOINT']);