Skip to content

Commit 8bed6f5

Browse files
authored
fix(vite-plugin): Fix HMR in Windows (#1093)
* fix(vite-plugin): fix HMR in Windows * chore: add changeset
1 parent c842fde commit 8bed6f5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/pink-students-grab.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 HMR in Windows by normalizing paths from `watchFiles`

packages/vite-plugin/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function vanillaExtractPlugin({
179179
for (const file of watchFiles) {
180180
// In start mode, we need to prevent the file from rewatching itself.
181181
// If it's a `build --watch`, it needs to watch everything.
182-
if (config.command === 'build' || file !== validId) {
182+
if (config.command === 'build' || normalizePath(file) !== validId) {
183183
this.addWatchFile(file);
184184
}
185185
}

0 commit comments

Comments
 (0)