remix: [Bug]: live reload rebuild twice when using tailwind watch
Which Remix packages are impacted?
-
remix(Remix core) -
create-remix -
@remix-run/architect -
@remix-run/cloudflare-workers -
@remix-run/dev -
@remix-run/express -
@remix-run/netlify -
@remix-run/node -
@remix-run/react -
@remix-run/serve -
@remix-run/server-runtime -
@remix-run/vercel
What version of Remix are you using?
1.0.6
Steps to Reproduce
Follow the styling section for tailwindcss in remix doc
Expected Behavior
live reload ignore the generated css file change
Actual Behavior
[1] šæ File changed: app/styles/app.css [1] šæ Rebuilding⦠[1] šæ Rebuilt in 226ms [1] GET /form 200 - - 31.452 ms [1] šæ File changed: app/styles/app.css [1] šæ Rebuilding⦠[1] šæ Rebuilt in 170ms
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (12 by maintainers)
There we go š https://github.com/postcss/postcss-cli/pull/417
My PR was merged into postcss-cli!
If you update your version to 9.1.0 or greater you should no longer get a double-refresh when you save a file unless you actually do change the CSS (like in the Tailwind JIT case, if you change the class name on an element). In that case youāll still get the double-reload. @ryanflorence had some ideas of how to avoid that once and for all. But the nice this is with postcss-cli 9.1.0 youāll no longer get an unnecessary rebuild š
Instead of adding a workaround to Remix, it could also be an option to try to get postcss to not write files if their content didnāt change (there is also existing issue for that https://github.com/postcss/postcss-cli/issues/320).
Thanks for this awesome improvement @kentcdodds !
That issue isnāt quite what we need. That issue just says: āif the input is the same as the output then donāt save the fileā but what we need is āif the output is the same as whatās currently in the output then donāt save the file.ā In any case, Iām going to look into implementing what we need.
It should now be fixed for Tailwind CLI. Iāll try again in the next 24 hours (when I can access my laptop). And if it works, I guess we could close the issue.
@edgesoft thanks! It works