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 8148af7 commit d413848
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit d413848

Please sign in to comment.