Skip to content

Commit cd0a272

Browse files
committed
move globals-init into bootstrap-amd (which is used by different parties)
1 parent d555777 commit cd0a272

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

src/bootstrap-amd.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
// when this file is bundled with other files.
1212
const nodeRequire = require;
1313

14+
// VSCODE_GLOBALS: node_modules
15+
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => nodeRequire(String(mod)) });
16+
17+
// VSCODE_GLOBALS: package/product.json
18+
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
19+
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
20+
1421
const loader = require('./vs/loader');
1522
const bootstrap = require('./bootstrap');
1623
const performance = require('./vs/base/common/performance');

src/bootstrap-fork.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ if (process.env['VSCODE_PARENT_PID']) {
3737
terminateWhenParentTerminates();
3838
}
3939

40-
// VSCODE_GLOBALS: node_modules
41-
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
42-
43-
// VSCODE_GLOBALS: package/product.json
44-
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
45-
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
46-
4740
// Load AMD entry point
4841
require('./bootstrap-amd').load(process.env['VSCODE_AMD_ENTRYPOINT']);
4942

src/main.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ function startup(codeCachePath, nlsConfig) {
141141
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig);
142142
process.env['VSCODE_CODE_CACHE_PATH'] = codeCachePath || '';
143143

144-
// VSCODE_GLOBALS: node_modules
145-
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
146-
147-
// VSCODE_GLOBALS: package/product.json
148-
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
149-
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
150-
151144
// Load main in AMD
152145
perf.mark('code/willLoadMainBundle');
153146
require('./bootstrap-amd').load('vs/code/electron-main/main', () => {

src/server-main.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,6 @@ 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), { get: (_target, mod) => require(String(mod)) });
264-
265-
// VSCODE_GLOBALS: package/product.json
266-
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
267-
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
268-
269262
delete process.env['ELECTRON_RUN_AS_NODE']; // Keep bootstrap-amd.js from redefining 'fs'.
270263

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

0 commit comments

Comments
 (0)