-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix: HMR behavior with CSS Modules #7434
Fix: HMR behavior with CSS Modules #7434
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Tested it out and it seems to work well. 😄
↪️ Pull Request
Fix: #7098
Hi team 👋
I investigated #7098, and considered the cause of this bug.
In my understanding,
.module.css asset
, incoming dep resolves above JS, so CSS’s HMR update messaging is skipped. (at /~https://github.com/parcel-bundler/parcel/blob/v2/packages/reporters/dev-server/src/HMRServer.js#L103-L125).I am a little worried that my understanding is incorrect, if you know somthing I missed, feel free to close this PR or point out it 🙇 .
💻 Examples
main.tsx
index.module.css
and update index.module.css, but HMR will not work.
🚨 Test instructions
I made integration test check that HMR correctly work with CSS Modules by comparing stylesheet’s href in
<link />
✔️ PR Todo