fix(vite): invalidate templates by dst not src (#21501)

This commit is contained in:
Daniel Roe 2023-06-10 18:14:58 +01:00 committed by GitHub
parent 8aa611a32e
commit c6a62268c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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!))
}
}