define globals for server-main too
parent
824c70b275
commit
e14d874adb
|
@ -259,6 +259,19 @@ function loadCode() {
|
|||
return new Promise((resolve, reject) => {
|
||||
const path = require('path');
|
||||
|
||||
// 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];
|
||||
}
|
||||
});
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
|
||||
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
|
||||
|
||||
delete process.env['ELECTRON_RUN_AS_NODE']; // Keep bootstrap-amd.js from redefining 'fs'.
|
||||
|
||||
// See https://github.com/microsoft/vscode-remote-release/issues/6543
|
||||
|
|
Loading…
Reference in New Issue