You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add CLI and config option to auto assign port #1191
It's useful to load multiple instances of the same project locally when you want to compare builds.
It's annoying to have to alter the package.json scripts to start up a new dev server with a different port.
Within projects, I often have multiple scripts within the package.json to start dev-servers with different environment variables and other options set. It's handy to be able to easily load up multiple dev servers without defining a specific port.
This can be closed, I now realised this project uses portfinder to assign a new port if the current one is in use. I don't believe there is any need to set port to 0 looking at current implementation?
I just realised that my project is still stuck on old version of webpack and webpack-dev-server and we cant use this feature until we upgrade to webpack2+, as portfinder plugin wasnt added to webpack-dev-server unil version 2.2.0.
@robert-prib-polestar thanks for following up. and wow, webpack 1.x is really old! the performance and fidelity improvements alone are worth the upgrade to webpack 3!
Activity
shellscape commentedon Nov 15, 2017
@robert-prib-polestar have you tried using a port set to
0? that should do it.robert-prib-polestar commentedon Nov 16, 2017
@shellscape I will give it a go, didn't realise that!
robert-prib-polestar commentedon Nov 16, 2017
This can be closed, I now realised this project uses portfinder to assign a new port if the current one is in use. I don't believe there is any need to set port to
0looking at current implementation?I just realised that my project is still stuck on old version of webpack and webpack-dev-server and we cant use this feature until we upgrade to webpack2+, as portfinder plugin wasnt added to webpack-dev-server unil version 2.2.0.
shellscape commentedon Nov 16, 2017
@robert-prib-polestar thanks for following up. and wow, webpack 1.x is really old! the performance and fidelity improvements alone are worth the upgrade to webpack 3!
montogeek commentedon Mar 28, 2018
@shellscape What you think about using https://github.com/node-modules/detect-port to do this?
shellscape commentedon Mar 28, 2018
@montogeek I no longer maintain this module and have shifted my focus to https://www.npmjs.com/package/webpack-serve. webpack-serve uses https://github.com/sindresorhus/get-port and I believe webpack-dev-server does as well iirc.