kirillplatonov / hotwire-livereload

Live reload gem for Hotwire Rails apps.
MIT License
483 stars 28 forks source link

Add configurable delay before reload #23

Closed alec-c4 closed 1 year ago

alec-c4 commented 2 years ago

Sometimes assets builder is not so fast as your gem :)

kirillplatonov commented 2 years ago

PR would be welcome for this feature 🙂 Do you have issues with webpack or another asset builder?

alec-c4 commented 2 years ago

I use esbuild :)

elik-ru commented 1 year ago

@alec-c4 Probably you should remove source files from watched dirs and watch only on build files.

LEstradioto commented 1 year ago

@elik-ru nice !

I was using esbuild and tailwind and having delay problems, solved by deleting app/assets/stylesheets and adding app/assets/builds to listen_paths, in my case:

# development.rb

  config.hotwire_livereload.disable_default_listeners = true
  config.hotwire_livereload.listen_paths = [
    Rails.root.join("app/views"),
    Rails.root.join("app/helpers"),
    Rails.root.join("app/javascript"),
    Rails.root.join("app/assets/images"),
    Rails.root.join("config/locales"),
    Rails.root.join("app/assets/builds")
  ]
elik-ru commented 1 year ago

@LEstradioto I have made a PR with many improvements: https://github.com/kirillplatonov/hotwire-livereload/pull/34 I would appreciate if you can give it a try and leave some feedback.

kirillplatonov commented 1 year ago

Added support for jsbundling-rails and cssbundling-rails output folder out of the box: https://github.com/kirillplatonov/hotwire-livereload/pull/37