Skip to content

Commit f0dd217

Browse files
authored
fix(plugin-webpack): protocol recognizes webpack's devServer setting (#3650)
1 parent 875ee54 commit f0dd217

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/plugin/webpack/src/WebpackConfig.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export default class WebpackConfigGenerator {
114114
if (this.isProd) {
115115
return `\`file://$\{require('path').resolve(__dirname, '..', 'renderer', '${entryPoint.name}', '${basename}')}\``;
116116
}
117-
const baseUrl = `http://localhost:${this.port}/${entryPoint.name}`;
117+
const protocol = this.pluginConfig.devServer?.server === 'https' ? 'https' : 'http';
118+
const baseUrl = `${protocol}://localhost:${this.port}/${entryPoint.name}`;
118119
if (basename !== 'index.html') {
119120
return `'${baseUrl}/${basename}'`;
120121
}

0 commit comments

Comments
 (0)