Skip to content

Commit

Permalink
fix(plugin-webpack): protocol recognizes webpack's devServer setting (
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogdriip authored Jul 9, 2024
1 parent 875ee54 commit f0dd217
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/plugin/webpack/src/WebpackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`;
}
Expand Down

0 comments on commit f0dd217

Please sign in to comment.