Skip to content

Commit

Permalink
Merge branch 'feat/docs_new_contribution_page' of github.com:ErKeLost…
Browse files Browse the repository at this point in the history
…/farm into feat/docs_new_contribution_page
  • Loading branch information
ErKeLost committed Nov 5, 2024
2 parents 00c678a + 817a882 commit 0703cea
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 0703cea

Please sign in to comment.