simplify _VSCODE_NODE_MODULES util

This commit is contained in:
Johannes
2022-11-17 17:58:51 +01:00
parent e14d874adb
commit d555777b1a
6 changed files with 8 additions and 48 deletions

View File

@@ -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`);