Skip to content

Commit

Permalink
fix(hmr): should break on first matched plugin that performs custom h…
Browse files Browse the repository at this point in the history
…mr handling
  • Loading branch information
yyx990803 committed Sep 8, 2021
1 parent fbd143a commit b3b8c61
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/vite/src/node/server/hmr.ts
Expand Up @@ -91,6 +91,7 @@ export async function handleHMRUpdate(
const filteredModules = await plugin.handleHotUpdate(hmrContext)
if (filteredModules) {
hmrContext.modules = filteredModules
break
}
}
}
Expand Down Expand Up @@ -461,15 +462,15 @@ async function restartServer(server: ViteDevServer) {
// @ts-ignore
global.__vite_start_time = Date.now()
const { port } = server.config.server

await server.close()

let newServer = null
try {
newServer = await createServer(server.config.inlineConfig)
} catch (err) {
} catch (err: any) {
server.config.logger.error(err.message, {
timestamp: true,
timestamp: true
})
return
}
Expand Down

0 comments on commit b3b8c61

Please sign in to comment.