Skip to content

Commit e14d874

Browse files
committed
define globals for server-main too
1 parent 824c70b commit e14d874

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/server-main.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,19 @@ function loadCode() {
259259
return new Promise((resolve, reject) => {
260260
const path = require('path');
261261

262+
// VSCODE_GLOBALS: node_modules
263+
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), {
264+
get(target, mod) {
265+
if (!target[mod] && typeof mod === 'string') {
266+
target[mod] = require(mod);
267+
}
268+
return target[mod];
269+
}
270+
});
271+
// VSCODE_GLOBALS: package/product.json
272+
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
273+
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
274+
262275
delete process.env['ELECTRON_RUN_AS_NODE']; // Keep bootstrap-amd.js from redefining 'fs'.
263276

264277
// See https://github.com/microsoft/vscode-remote-release/issues/6543

0 commit comments

Comments
 (0)