From 59c9202c2006ef5ab672276fcbcdb2e8cde3414b Mon Sep 17 00:00:00 2001 From: Devraj Mehta Date: Wed, 29 Jan 2025 15:08:18 -0500 Subject: [PATCH 1/2] fix: add electron as an external for webpack --- extensions/github-authentication/extension.webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/github-authentication/extension.webpack.config.js b/extensions/github-authentication/extension.webpack.config.js index df3adb4ee7a3f..bc9d3a4e759de 100644 --- a/extensions/github-authentication/extension.webpack.config.js +++ b/extensions/github-authentication/extension.webpack.config.js @@ -13,5 +13,8 @@ module.exports = withDefaults({ context: __dirname, entry: { extension: './src/extension.ts', + }, + externals: { + 'electron': 'commonjs electron', } }); From c4b0c173773d44283788f0aea9ddb85efa94a462 Mon Sep 17 00:00:00 2001 From: Devraj Mehta Date: Wed, 29 Jan 2025 15:13:41 -0500 Subject: [PATCH 2/2] refactor: move electron external to shared webpack --- extensions/github-authentication/extension.webpack.config.js | 3 --- extensions/shared.webpack.config.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/extensions/github-authentication/extension.webpack.config.js b/extensions/github-authentication/extension.webpack.config.js index bc9d3a4e759de..d356151d68c57 100644 --- a/extensions/github-authentication/extension.webpack.config.js +++ b/extensions/github-authentication/extension.webpack.config.js @@ -14,7 +14,4 @@ module.exports = withDefaults({ entry: { extension: './src/extension.ts', }, - externals: { - 'electron': 'commonjs electron', - } }); diff --git a/extensions/shared.webpack.config.js b/extensions/shared.webpack.config.js index 279bc199bc4a9..ad9d70c249087 100644 --- a/extensions/shared.webpack.config.js +++ b/extensions/shared.webpack.config.js @@ -56,6 +56,7 @@ function withNodeDefaults(/**@type WebpackConfig & { context: string }*/extConfi }] }, externals: { + 'electron': 'commonjs electron', // ignored to avoid bundling from node_modules 'vscode': 'commonjs vscode', // ignored because it doesn't exist, 'applicationinsights-native-metrics': 'commonjs applicationinsights-native-metrics', // ignored because we don't ship native module '@azure/functions-core': 'commonjs azure/functions-core', // optioinal dependency of appinsights that we don't use @@ -204,4 +205,3 @@ module.exports.node = withNodeDefaults; module.exports.browser = withBrowserDefaults; module.exports.nodePlugins = nodePlugins; module.exports.browserPlugins = browserPlugins; -