simplify `_VSCODE_NODE_MODULES` util
parent
e14d874adb
commit
d555777b1a
|
@ -38,14 +38,7 @@ if (process.env['VSCODE_PARENT_PID']) {
|
|||
}
|
||||
|
||||
// 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];
|
||||
}
|
||||
});
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
|
||||
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
|
||||
|
|
|
@ -113,14 +113,7 @@
|
|||
window['MonacoEnvironment'] = {};
|
||||
|
||||
// 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.__$__nodeRequire ?? require)(mod);
|
||||
}
|
||||
return target[mod];
|
||||
}
|
||||
});
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => (require.__$__nodeRequire ?? require)(String(mod)) });
|
||||
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json');
|
||||
|
|
|
@ -142,14 +142,7 @@ function startup(codeCachePath, nlsConfig) {
|
|||
process.env['VSCODE_CODE_CACHE_PATH'] = codeCachePath || '';
|
||||
|
||||
// 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];
|
||||
}
|
||||
});
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
|
||||
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
|
||||
|
|
|
@ -260,14 +260,8 @@ function loadCode() {
|
|||
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];
|
||||
}
|
||||
});
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
|
||||
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
|
||||
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
|
||||
|
|
|
@ -73,14 +73,8 @@ if (util.inspect && util.inspect['defaultOptions']) {
|
|||
}
|
||||
|
||||
// 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.__$__nodeRequire ?? require)(mod);
|
||||
}
|
||||
return target[mod];
|
||||
}
|
||||
});
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => (require.__$__nodeRequire ?? require)(String(mod)) });
|
||||
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)('../../../product.json');
|
||||
globalThis._VSCODE_PACKAGE_JSON = (require.__$__nodeRequire ?? require)('../../../package.json');
|
||||
|
|
|
@ -58,14 +58,7 @@ if (majorRequiredNodeVersion !== currentMajorNodeVersion) {
|
|||
function main() {
|
||||
|
||||
// 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];
|
||||
}
|
||||
});
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
|
||||
|
||||
// VSCODE_GLOBALS: package/product.json
|
||||
globalThis._VSCODE_PRODUCT_JSON = require(`${REPO_ROOT}/product.json`);
|
||||
|
|
Loading…
Reference in New Issue