Skip to content

Commit 495d4d5

Browse files
committed
fix: auto logic
1 parent 6d382bd commit 495d4d5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/Server.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,8 @@ class Server {
772772
);
773773
}
774774

775-
const shouldFindPort = this.options.port === 'auto';
776-
const initialPort = shouldFindPort ? null : port || this.options.port;
777775
return (
778-
findPort(initialPort)
776+
findPort(port || this.options.port)
779777
// eslint-disable-next-line no-shadow
780778
.then((port) => {
781779
this.options.port = port;

lib/utils/findPort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function runPortFinder() {
1818
}
1919

2020
function findPort(port) {
21-
if (port) {
21+
if (port && port !== 'auto') {
2222
return Promise.resolve(port);
2323
}
2424

0 commit comments

Comments
 (0)