Skip to content

Commit

Permalink
fix(plugin-vue): trigger scss hmr on custom template languages(fix vi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jevon617 committed Nov 9, 2022
1 parent d5fe92c commit e323000
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/plugin-vue/src/handleHotUpdate.ts
Expand Up @@ -147,8 +147,10 @@ export async function handleHotUpdate(
if (!templateModule) {
affectedModules.add(mainModule)
} else if (mainModule && !affectedModules.has(mainModule)) {
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)($|\\?)`
const cssLangRE = new RegExp(cssLangs)
const styleImporters = [...mainModule.importers].filter((m) =>
/\.css($|\?)/.test(m.url)
cssLangRE.test(m.url)
)
styleImporters.forEach((m) => affectedModules.add(m))
}
Expand Down

0 comments on commit e323000

Please sign in to comment.