From 2a38ef7501972fbdb2531cc1207884b3fb9603a9 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 11 Jul 2023 22:11:59 +0800 Subject: [PATCH] fix(server): remove restart guard on restart (#13789) --- packages/vite/src/node/server/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/vite/src/node/server/index.ts b/packages/vite/src/node/server/index.ts index 46d98dae645fc6..ccec3b77400a65 100644 --- a/packages/vite/src/node/server/index.ts +++ b/packages/vite/src/node/server/index.ts @@ -854,9 +854,7 @@ async function restartServer(server: ViteDevServer) { await server.close() - // prevent new server `restart` function from calling - newServer._restartPromise = server._restartPromise - + // Assign new server props to existing server instance Object.assign(server, newServer) const { @@ -883,9 +881,6 @@ async function restartServer(server: ViteDevServer) { shortcutsOptions.print = false bindShortcuts(newServer, shortcutsOptions) } - - // new server (the current server) can restart now - newServer._restartPromise = null } async function updateCjsSsrExternals(server: ViteDevServer) {