Rails 7 + Tailwind not refreshing css

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

rails new tailwind --force --javascript=esbuild --css=tailwind
cd tailwind/
rails db:create
rails db:migrate
rails g controller demo show
./bin/dev
  1. Access localhost:3000/demo/show
  2. 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>
  1. Reload localhost:3000/demo/show

And you won’t see any tailwind style applied to the button without stoping/restarting the server.