Skip to content

Commit

Permalink
fix hmr : invalidate css files
Browse files Browse the repository at this point in the history
  • Loading branch information
franck-co committed Dec 11, 2023
1 parent 2a0bd2a commit 617e034
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,13 @@ export function vanillaExtractPlugin({
const modules = Array.from(
moduleGraph.getModulesByFile(absoluteIdNoExt) || []
)
const virtualCSSModules = Array.from(
moduleGraph.getModulesByFile(
`${absoluteIdNoExt}${virtualExtCss}`
) || []
)

for (const module of modules) {
for (const module of [...modules, ...virtualCSSModules]) {
if (module) {
moduleGraph.invalidateModule(module)

Expand Down

0 comments on commit 617e034

Please sign in to comment.