This tutorial will explore a modern way to live-reload a rails app set-up with css-bundling (tailwind) and js-bundling (esbuild).
group :development do gem "hotwire-livereload" end
View, helpers, and assets files are listened for by default.
If you use rails's
js-bundling gems, find the bundled JS and CSS file
The app/builds folder includes:
An additional watch process is needed to re-build the JS and CSS file after changes (see docs). Tailwind, for example, uses a Just-in-time compiler to only add classes to the CSS that are being used in your application. This requires specifying an additional path to listen for any (Just-in-time) changes.
# config/environments/development.rb config.hotwire_livereload.listen_paths << Rails.root.join("app/assets/builds")