Skip to content

Commit

Permalink
introduce product.overrides.json
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Apr 5, 2023
1 parent 899cdd5 commit d8fccd8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ vscode.lsif
vscode.db
/.profile-oss
/cli/target
product.overrides.json
6 changes: 5 additions & 1 deletion src/bootstrap-amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit d8fccd8

Please sign in to comment.