Skip to content

Commit 8295518

Browse files
committed
don't require-read product/package.json when running in sandbox mode
1 parent 34ce6e2 commit 8295518

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bootstrap-window.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@
115115
// VSCODE_GLOBALS: node_modules
116116
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => (require.__$__nodeRequire ?? require)(String(mod)) });
117117

118-
// VSCODE_GLOBALS: package/product.json
119-
globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json');
120-
globalThis._VSCODE_PACKAGE_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/package.json');
118+
if (!safeProcess.sandboxed) {
119+
// VSCODE_GLOBALS: package/product.json
120+
globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json');
121+
globalThis._VSCODE_PACKAGE_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/package.json');
122+
}
121123

122124
const loaderConfig = {
123125
baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,

0 commit comments

Comments
 (0)