Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R20-1977] - Patch vite-plugin-vue to fix CSS files not triggering HMR #1206

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,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]"
}
}
}
18 changes: 18 additions & 0 deletions patches/@[email protected]
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,
28 changes: 16 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading