windicss-webpack-plugin
windicss-webpack-plugin copied to clipboard
HMR for NextJS failed on windi.config.js change
Describe the bug
As title. It seems windi.config.js
change doesn't cause HMR on a next.js project.
To Reproduce Steps to reproduce the behavior:
- Clone repository: https://github.com/donrsh/issue-NextJS-HMR-on-windi-config-change
- Run
yarn dev
- Visit http://localhost:3000
- Modify extend color in
windi.config.js
(e.g.red: "#f00"
->red: "#0f0"
)
Expected behavior
Observe that the title that consumes text-red
(pages/index.js
- line15) class didn't change color. Even reload doesn't trigger the update. One needs to rerun the dev server for the change to apply.
Screenshots
The color of highlighted texts should change.
Additional context I work on Windows.
Hey @donrsh
Thanks for the issue and reproduction link!
I took a quick look and unfortunately couldn't replicate the issue. Which means it's either one of two things:
- Something weird going on with your caching, try deleting the
node_modules/.cache
folder - A windows specific issue on watching files
If it's not the first issue then it's a bit tricky for me to debug since I don't have windows. What might help is to run it in debug mode
"dev": "set DEBUG=windicss-webpack* && next dev",
if set doesn't work, try cross-env
Can you see if you have a line like this
windicss-webpack-plugin:plugin config dependency at /home/harlan/packages/webpack-windicss-plugin/issue-NextJS-HMR-on-windi-config-change/windi.config.js +60ms
Also can you paste the contents of the debug once you modify the file, if any
Hi, @harlan-zw, thanks for the help.
By following the instruction, here's the results
-
There is a line saying the
windi.config.js
is used: -
No output to terminal after
windi.config.js
change. While modifying the page files DOES show some stuff: