fix: normalize postcss dependency messages #6959
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
It seems Vite normalizes
dir-dependency
messages but notdependency
messages.On my Windows machine, files defined in
tailwind.config.js
without glob patterns was not triggering HMR updates for CSS files.Tailwind sends
dependency
message for non-glob patterns anddir-dependency
message for glob patterns:https://github.com/tailwindlabs/tailwindcss/blob/23b1b301a11178697db6f0b12785f99945fe0ef4/src/util/parseDependency.js#L35-L40
Take this config as reference:
Changes in files matching with
./src/components/**/*.vue
pattern will trigger CSS HMR for those files, but changes in./src/App.vue
will not.Reproduction:
https://github.com/sibbng/vite-tailwind-repro
Steps:
App.vue
, change will not trigger HMR for style.cssHelloWorld.vue
, change will trigger HMR for style.css and both div's background should be updatedAdditional context
This issue could potentially
fix
#5808. But this bug report comes from a macOS user and there is no reproduction.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).