fix(vite): invalidate virtual files when changed (#6038)

This commit is contained in:
Daniel Roe 2022-07-21 15:21:58 +01:00 committed by GitHub
parent 4d80c43d25
commit 45b449ed05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ export async function bundle (nuxt: Nuxt) {
// Invalidate virtual modules when templates are re-generated
ctx.nuxt.hook('app:templatesGenerated', () => {
for (const [id, mod] of server.moduleGraph.idToModuleMap) {
if (id.startsWith('\x00virtual:')) {
if (id.startsWith('virtual:')) {
server.moduleGraph.invalidateModule(mod)
}
}