Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-vue): support scss/sass/less... hmr on custom template languages(fix #10677) #10844

Merged
merged 5 commits into from
Nov 22, 2022
Merged
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
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)($|\\?)`
benmccann marked this conversation as resolved.
Show resolved Hide resolved
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