Skip to content

Commit

Permalink
Merge pull request #26 from franck-co/invalidate-css
Browse files Browse the repository at this point in the history
fix hmr : invalidate css files
  • Loading branch information
wmertens authored Jan 5, 2024
2 parents 2a0bd2a + 617e034 commit 9563939
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 9563939

Please sign in to comment.