Skip to content

Commit 1595c5b

Browse files
committed
define globals for server-main too
1 parent 1a0223d commit 1595c5b

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
@@ -258,6 +258,19 @@ function loadCode() {
258258
return new Promise((resolve, reject) => {
259259
const path = require('path');
260260

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

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

0 commit comments

Comments
 (0)