-
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.
chore: patch vite-plugin-vue to fix CSS files not triggering HMR
- Loading branch information
1 parent
b42a96e
commit b4e0f3f
Showing
3 changed files
with
36 additions
and
13 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
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.