Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: server restart not display resolveUrls (#1911) #1915

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/core/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,16 @@ export class Server extends httpServer {
const { port: prevPort, host: prevHost } = this.serverOptions;
const prevUrls = this.resolvedUrls;

await this.restart();

const { port, host } = this.serverOptions;
const newServer = await this.restart();
const {
serverOptions: { port, host },
resolvedUrls
} = newServer;

if (
port !== prevPort ||
host !== prevHost ||
this.hasUrlsChanged(prevUrls, this.resolvedUrls)
this.hasUrlsChanged(prevUrls, resolvedUrls)
) {
__FARM_GLOBAL__.__FARM_SHOW_DEV_SERVER_URL__ = true;
} else {
Expand Down Expand Up @@ -356,6 +358,7 @@ export class Server extends httpServer {
await this.watcher.close();
await newServer.listen();
this.logger.info(bold(green('Server restarted successfully ✨ ✨')));
return newServer;
}

/**
Expand Down
Loading