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
Show file tree
Hide file tree
Changes from all commits
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
@@ -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
3 changes: 2 additions & 1 deletion packages/vite/src/node/publicUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export { version as esbuildVersion } from 'esbuild'
export { VERSION as rollupVersion } from 'rollup'
export {
splitVendorChunkPlugin,
splitVendorChunk
splitVendorChunk,
isCSSRequest
} from './plugins/splitVendorChunk'
export { normalizePath, mergeConfig, mergeAlias, createFilter } from './utils'
export { send } from './server/send'
Expand Down