From f0dd217248693b5e56123e5caa60df535ffc490f Mon Sep 17 00:00:00 2001 From: "Hyunseung Jeon (aru@channel.io)" Date: Wed, 10 Jul 2024 03:56:29 +0900 Subject: [PATCH] fix(plugin-webpack): protocol recognizes webpack's `devServer` setting (#3650) --- packages/plugin/webpack/src/WebpackConfig.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugin/webpack/src/WebpackConfig.ts b/packages/plugin/webpack/src/WebpackConfig.ts index f22c6b88ae..6af6672e33 100644 --- a/packages/plugin/webpack/src/WebpackConfig.ts +++ b/packages/plugin/webpack/src/WebpackConfig.ts @@ -114,7 +114,8 @@ export default class WebpackConfigGenerator { if (this.isProd) { return `\`file://$\{require('path').resolve(__dirname, '..', 'renderer', '${entryPoint.name}', '${basename}')}\``; } - const baseUrl = `http://localhost:${this.port}/${entryPoint.name}`; + const protocol = this.pluginConfig.devServer?.server === 'https' ? 'https' : 'http'; + const baseUrl = `${protocol}://localhost:${this.port}/${entryPoint.name}`; if (basename !== 'index.html') { return `'${baseUrl}/${basename}'`; }