Skip to content

Commit

Permalink
fix: allow falsy values for port option (#2962)
Browse files Browse the repository at this point in the history
`webpack-dev-server@3` allows using `null` or `0` to automatically use a free port.
  • Loading branch information
henryqdineen authored and anshumanv committed Oct 20, 2021
1 parent bb7e663 commit 1d5fc4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/serve/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ class ServeCommand {
};

devServerOptions.host = devServerOptions.host || "localhost";
devServerOptions.port = devServerOptions.port || 8080;
devServerOptions.port =
typeof devServerOptions.port !== "undefined" ? devServerOptions.port : 8080;
devServerOptions.stats = getStatsOption();
devServerOptions.publicPath = getPublicPathOption();
}
Expand Down

0 comments on commit 1d5fc4e

Please sign in to comment.