From 8ce218ca2609af4311bae7c4e0b1f0a6c8fdbb2c Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 6 Sep 2021 07:53:01 +0200 Subject: [PATCH] bootstrap - fix loader paths for running out of sources --- src/bootstrap-window.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js index 0f613a8ee4e..882ee8b7335 100644 --- a/src/bootstrap-window.js +++ b/src/bootstrap-window.js @@ -43,9 +43,10 @@ * }} [options] */ async function load(modulePaths, resultCallback, options) { + const isDev = !!safeProcess.env['VSCODE_DEV']; // Error handler (TODO@sandbox non-sandboxed only) - let showDevtoolsOnError = !!safeProcess.env['VSCODE_DEV']; + let showDevtoolsOnError = isDev; safeProcess.on('uncaughtException', function (/** @type {string | Error} */ error) { onUnexpectedError(error, showDevtoolsOnError); }); @@ -75,8 +76,8 @@ disallowReloadKeybinding: false, removeDeveloperKeybindingsAfterLoad: false }; - showDevtoolsOnError = safeProcess.env['VSCODE_DEV'] && !forceDisableShowDevtoolsOnError; - const enableDeveloperKeybindings = safeProcess.env['VSCODE_DEV'] || forceEnableDeveloperKeybindings; + showDevtoolsOnError = isDev && !forceDisableShowDevtoolsOnError; + const enableDeveloperKeybindings = isDev || forceEnableDeveloperKeybindings; let developerDeveloperKeybindingsDisposable; if (enableDeveloperKeybindings) { developerDeveloperKeybindingsDisposable = registerDeveloperKeybindings(disallowReloadKeybinding); @@ -127,17 +128,18 @@ // Teach the loader the location of the node modules we use in renderers // This will enable to load these modules via