mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-05 13:17:23 +02:00
fix(core): conditionally include hostname
parameter when using… (#9407)
This commit is contained in:
parent
a2c8b4185b
commit
bd1a2aa3c5
1 changed files with 4 additions and 1 deletions
|
@ -54,7 +54,10 @@ async function choosePort(
|
|||
defaultPort: number,
|
||||
): Promise<number | null> {
|
||||
try {
|
||||
const port = await detect({port: defaultPort, hostname: host});
|
||||
const port = await detect({
|
||||
port: defaultPort,
|
||||
...(host !== 'localhost' && {hostname: host}),
|
||||
});
|
||||
if (port === defaultPort) {
|
||||
return port;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue