Skip to content

Commit f2d1d29

Browse files
authored
fix(plugin-vue): support scss/sass/less... hmr on custom template languages (fix #10677) (#10844)
1 parent cf93616 commit f2d1d29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/plugin-vue/src/handleHotUpdate.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import _debug from 'debug'
22
import type { SFCBlock, SFCDescriptor } from 'vue/compiler-sfc'
33
import type { HmrContext, ModuleNode } from 'vite'
4+
import { isCSSRequest } from 'vite'
5+
46
import {
57
createDescriptor,
68
getDescriptor,
@@ -153,7 +155,7 @@ export async function handleHotUpdate(
153155
affectedModules.add(mainModule)
154156
} else if (mainModule && !affectedModules.has(mainModule)) {
155157
const styleImporters = [...mainModule.importers].filter((m) =>
156-
/\.css(?:$|\?)/.test(m.url)
158+
isCSSRequest(m.url)
157159
)
158160
styleImporters.forEach((m) => affectedModules.add(m))
159161
}

0 commit comments

Comments
 (0)