Skip to content

Commit da17b90

Browse files
committed
Do not allow webpack-dev-server to find an open port
This is unfortunate, as this is a nice feature of webpack-dev-server where if port 8080 is open, it will try 8081, etc. However, because we need to build a manifest.json file, we need to know what the port is for sure at Webpack config build time. Even going through the same async process of using the "find-port" package isn't really doable... as it would make the entire config generation async (this may be possible, but would change a ton of things in Encore).
1 parent 8c2752a commit da17b90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/config-generator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,11 @@ class ConfigGenerator {
606606
client: {
607607
// see https://github.com/symfony/webpack-encore/issues/931#issuecomment-784483725
608608
host: this.webpackConfig.runtimeConfig.devServerHost,
609-
}
609+
},
610+
// see https://github.com/symfony/webpack-encore/issues/941#issuecomment-787568811
611+
// we cannot let webpack-dev-server find an open port, because we need
612+
// to know the port for sure at Webpack config build time
613+
port: this.webpackConfig.runtimeConfig.devServerPort,
610614
};
611615

612616
return applyOptionsCallback(

0 commit comments

Comments
 (0)