Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

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

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vite/src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down