Search code examples
ruby-on-railstailwind-ui

How can I update Tailwind without having to precompile assets every time? (Rails 7)


I'm using Rails 7 and Tailwind UI. Every time I add or change a tailwind class, I have to

rake assets:precompile

to make it show the new styles. Is there a way to make it compile without that in Rails 7?


Solution

  • I've just have the same issue. I fixed by using ./bin/dev instead of rails s And configure the Profile.dev file to the root of the project with this content:

    web: bin/rails server -p 3000
    css: bin/rails tailwindcss:watch
    

    Bonus : I've installed this gem to have livereload: https://github.com/railsjazz/rails_live_reload