I wanted to test the new integration of Tailwind CSS with Rails 7, just wrote a bit of code to see how this works… Normally, whenever the views are modified, the bundler should regenerate the CSS… but it does not. I need to stop the server (./bin/dev) and restart the server to see my changes. Any idea why?
To reproduce it
- Access localhost:3000/demo/show
- Then just modify the view demo/show.html.erb to use Tailwind css e.g.
<button class="bg-sky-500 hover:bg-sky-700 px-5 py-2 text-sm leading-5 rounded-full font-semibold text-white"> Save changes </button>
- Reload localhost:3000/demo/show
And you won’t see any tailwind style applied to the button without stoping/restarting the server.