mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-06 21:57:14 +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,
|
defaultPort: number,
|
||||||
): Promise<number | null> {
|
): Promise<number | null> {
|
||||||
try {
|
try {
|
||||||
const port = await detect({port: defaultPort, hostname: host});
|
const port = await detect({
|
||||||
|
port: defaultPort,
|
||||||
|
...(host !== 'localhost' && {hostname: host}),
|
||||||
|
});
|
||||||
if (port === defaultPort) {
|
if (port === defaultPort) {
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue