-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[R20-1977] - Patch vite-plugin-vue to fix CSS files not triggering HMR
- Loading branch information
Showing
3 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,7 +109,8 @@ | |
"vite@>=5.1.0 <=5.1.6": ">=5.1.7" | ||
}, | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
"[email protected]": "patches/[email protected]", | ||
"@vitejs/[email protected]": "patches/@[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/dist/index.mjs b/dist/index.mjs | ||
index 651cce2951161bfd811ef55f4ed5c4ed6a676dde..fa381af3d9cc6eab21bd13a41768f8df4940936c 100644 | ||
--- a/dist/index.mjs | ||
+++ b/dist/index.mjs | ||
@@ -2917,6 +2917,13 @@ function vuePlugin(rawOptions = {}) { | ||
); | ||
} else { | ||
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value); | ||
+ | ||
+ // TEMPORARY PATCH: https://github.com/vitejs/vite-plugin-vue/issues/397 | ||
+ // Fixes CSS files imported into .vue files not being watched | ||
+ if (query.src) { | ||
+ this.addWatchFile(filename); | ||
+ } | ||
+ | ||
if (query.type === "template") { | ||
return transformTemplateAsModule( | ||
code, |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.