diff --git a/packages/vite/src/runtime/vite-node.mjs b/packages/vite/src/runtime/vite-node.mjs index dcf89ccc97c..88b63e3fb21 100644 --- a/packages/vite/src/runtime/vite-node.mjs +++ b/packages/vite/src/runtime/vite-node.mjs @@ -22,5 +22,6 @@ export default async (ssrContext) => { process.server = true render = render || (await runner.executeFile(viteNodeOptions.entryPath)).default const result = await render(ssrContext) + runner.moduleCache.clear() return result }