From d8fccd8a92414c95f274182b12739b5c66f88ac6 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Apr 2023 16:32:01 +0200 Subject: [PATCH] introduce product.overrides.json --- .gitignore | 1 + src/bootstrap-amd.js | 6 +++++- src/bootstrap-window.js | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c338e141c8d..4306e9589e8 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ vscode.lsif vscode.db /.profile-oss /cli/target +product.overrides.json diff --git a/src/bootstrap-amd.js b/src/bootstrap-amd.js index 9905289f5d8..257d033cdbb 100644 --- a/src/bootstrap-amd.js +++ b/src/bootstrap-amd.js @@ -15,7 +15,11 @@ const nodeRequire = require; globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => nodeRequire(String(mod)) }); // VSCODE_GLOBALS: package/product.json -globalThis._VSCODE_PRODUCT_JSON = require('../product.json'); +if (process.env['VSCODE_DEV']) { + globalThis._VSCODE_PRODUCT_JSON = Object.assign(require('../product.json'), require('../product.overrides.json')); +} else { + globalThis._VSCODE_PRODUCT_JSON = require('../product.json'); +} globalThis._VSCODE_PACKAGE_JSON = require('../package.json'); // @ts-ignore diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js index d61e432e3b3..21607f2efdb 100644 --- a/src/bootstrap-window.js +++ b/src/bootstrap-window.js @@ -117,7 +117,11 @@ if (!safeProcess.sandboxed) { // VSCODE_GLOBALS: package/product.json - globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json'); + if (process.env['VSCODE_DEV']) { + globalThis._VSCODE_PRODUCT_JSON = Object.assign((require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json'), (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.overrides.json')); + } else { + globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json'); + } globalThis._VSCODE_PACKAGE_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/package.json'); }