From e22bbcc3808ff8583a3f02afa2baf239d2e83aa8 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 8 Sep 2022 15:17:22 +0100 Subject: [PATCH] fix(vite): update render if it is invalidated (#7347) --- packages/vite/src/runtime/vite-node.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/runtime/vite-node.mjs b/packages/vite/src/runtime/vite-node.mjs index a2eea980f3..898da3055f 100644 --- a/packages/vite/src/runtime/vite-node.mjs +++ b/packages/vite/src/runtime/vite-node.mjs @@ -22,7 +22,7 @@ export default async (ssrContext) => { // Execute SSR bundle on demand const start = performance.now() - render = render || (await runner.executeFile(viteNodeOptions.entryPath)).default + render = (updates.has(viteNodeOptions.entryPath) || !render) ? (await runner.executeFile(viteNodeOptions.entryPath)).default : render if (updates.size) { const time = Math.round((performance.now() - start) * 1000) / 1000 consola.success(`Vite server hmr ${updates.size} files`, time ? `in ${time}ms` : '')