From 6cd3352dec136c823e8463cca20475591885d267 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 17 Nov 2024 14:32:31 -0500 Subject: [PATCH] fix(vite): use resolved nuxt template `dst` to invalidate modules --- packages/vite/src/vite-node.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vite/src/vite-node.ts b/packages/vite/src/vite-node.ts index bb63c257b9..ad9ee435a2 100644 --- a/packages/vite/src/vite-node.ts +++ b/packages/vite/src/vite-node.ts @@ -45,11 +45,11 @@ export function viteNodePlugin (ctx: ViteBuildContext): VitePlugin { markInvalidate(mod) } } - for (const plugin of ctx.nuxt.options.plugins) { - markInvalidates(server.moduleGraph.getModulesByFile(typeof plugin === 'string' ? plugin : plugin.src)) - } - for (const template of ctx.nuxt.options.build.templates) { - markInvalidates(server.moduleGraph.getModulesByFile(template.dst!)) + + if (ctx.nuxt.apps.default) { + for (const template of ctx.nuxt.apps.default.templates) { + markInvalidates(server.moduleGraph.getModulesByFile(template.dst!)) + } } }