Skip to content

Commit

Permalink
fix(plugin-vue): trigger css hmr on custom template languages (#6987)
Browse files Browse the repository at this point in the history
Co-authored-by: patak <[email protected]>
  • Loading branch information
sibbng and patak-dev authored May 13, 2022
1 parent 83ddf72 commit 4980edd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ export async function handleHotUpdate(
// template is inlined into main, add main module instead
if (!templateModule) {
affectedModules.add(mainModule)
} else if (mainModule && !affectedModules.has(mainModule)) {
const styleImporters = [...mainModule.importers].filter((m) =>
/\.css($|\?)/.test(m.url)
)
styleImporters.forEach((m) => affectedModules.add(m))
}
}
if (didUpdateStyle) {
Expand Down

0 comments on commit 4980edd

Please sign in to comment.