From c6a62268c3f466054249e33c7db3ac37452cdf03 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 10 Jun 2023 18:14:58 +0100 Subject: [PATCH] fix(vite): invalidate templates by `dst` not `src` (#21501) --- packages/vite/src/vite-node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/vite-node.ts b/packages/vite/src/vite-node.ts index a65c6f5160..9d66dd9e6c 100644 --- a/packages/vite/src/vite-node.ts +++ b/packages/vite/src/vite-node.ts @@ -48,7 +48,7 @@ export function viteNodePlugin (ctx: ViteBuildContext): VitePlugin { markInvalidates(server.moduleGraph.getModulesByFile(typeof plugin === 'string' ? plugin : plugin.src)) } for (const template of ctx.nuxt.options.build.templates) { - markInvalidates(server.moduleGraph.getModulesByFile(template?.src as string)) + markInvalidates(server.moduleGraph.getModulesByFile(template.dst!)) } }