mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
fix(vite): use resolved nuxt template dst
to invalidate modules
This commit is contained in:
parent
d44408e87b
commit
6cd3352dec
@ -45,13 +45,13 @@ 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) {
|
||||
|
||||
if (ctx.nuxt.apps.default) {
|
||||
for (const template of ctx.nuxt.apps.default.templates) {
|
||||
markInvalidates(server.moduleGraph.getModulesByFile(template.dst!))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server.middlewares.use('/__nuxt_vite_node__', toNodeListener(createViteNodeApp(ctx, invalidates)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user