Skip to content

Commit 162b66f

Browse files
AndrewLeedhampakholeung37mattcompiles
authored
vite: Absolute module id for invalidation (#707)
Co-authored-by: pakholeung37 <[email protected]> Co-authored-by: mattcompiles <[email protected]>
1 parent ac8ad84 commit 162b66f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/cold-phones-deny.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vanilla-extract/vite-plugin": patch
3+
---
4+
5+
Fix styles not updating in dev mode

packages/vite-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ export function vanillaExtractPlugin({ identifiers }: Options = {}): Plugin {
163163

164164
if (server && cssMap.has(id) && cssMap.get(id) !== source) {
165165
const { moduleGraph } = server;
166-
const module = moduleGraph.getModuleById(id);
166+
const moduleId = normalizePath(path.join(config.root, id));
167+
const module = moduleGraph.getModuleById(moduleId);
167168

168169
if (module) {
169170
moduleGraph.invalidateModule(module);

0 commit comments

Comments
 (0)