I'm submitting a feature request
Current behavior:
Two webpack-dev-server CLI instances without a specified port will both try to use port 8080, and the second will crash.
Expected/desired behavior:
If no port has been explicitly specified via config options or command args, then portfinder should be used to find the first available port after 8080. This behavior is identical to the http-server CLI. If I specify a port for each dev server, then they should still only try the specified ports.
What is the motivation / use case for changing the behavior?
If I haven't specified a port, chances are I just want the server to work, and I'll either pass --open or check stdout for the port I need to open in my browser. If I'm testing many webpack dev servers for several projects, I don't want to have to manually pass ports I've determined to be available.
It's already possible to do this via the Node API, but with this feature in the CLI I would have no need for the Node API (almost 50 lines of JavaScript seems like a bit much for this).
It's my opinion this behavior should be default, but at the least it should be an option.
Question
I'm unsure whether this behavior should extend to the Node API as well (though I was initially only thinking of targeting the CLI).
I'm already looking into this, and I'd like to submit a pull request.
I'm submitting a feature request
Current behavior:
Two
webpack-dev-serverCLI instances without a specified port will both try to use port 8080, and the second will crash.Expected/desired behavior:
If no port has been explicitly specified via config options or command args, then
portfindershould be used to find the first available port after 8080. This behavior is identical to thehttp-serverCLI. If I specify a port for each dev server, then they should still only try the specified ports.What is the motivation / use case for changing the behavior?
If I haven't specified a port, chances are I just want the server to work, and I'll either pass
--openor check stdout for the port I need to open in my browser. If I'm testing many webpack dev servers for several projects, I don't want to have to manually pass ports I've determined to be available.It's already possible to do this via the Node API, but with this feature in the CLI I would have no need for the Node API (almost 50 lines of JavaScript seems like a bit much for this).
It's my opinion this behavior should be default, but at the least it should be an option.
Question
I'm unsure whether this behavior should extend to the Node API as well (though I was initially only thinking of targeting the CLI).
I'm already looking into this, and I'd like to submit a pull request.