Skip to content

Commit

Permalink
fix(plugin-vue): support scss/sass/less... hmr on custom template lan…
Browse files Browse the repository at this point in the history
…guages (fix #10677) (#10844)
  • Loading branch information
Jevon617 authored Nov 22, 2022
1 parent cf93616 commit f2d1d29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import _debug from 'debug'
import type { SFCBlock, SFCDescriptor } from 'vue/compiler-sfc'
import type { HmrContext, ModuleNode } from 'vite'
import { isCSSRequest } from 'vite'

import {
createDescriptor,
getDescriptor,
Expand Down Expand Up @@ -153,7 +155,7 @@ export async function handleHotUpdate(
affectedModules.add(mainModule)
} else if (mainModule && !affectedModules.has(mainModule)) {
const styleImporters = [...mainModule.importers].filter((m) =>
/\.css(?:$|\?)/.test(m.url)
isCSSRequest(m.url)
)
styleImporters.forEach((m) => affectedModules.add(m))
}
Expand Down

0 comments on commit f2d1d29

Please sign in to comment.