hotwire-livereload icon indicating copy to clipboard operation
hotwire-livereload copied to clipboard

Add configurable delay before reload

Open alec-c4 opened this issue 3 years ago • 2 comments

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

alec-c4 avatar Jun 01 '22 09:06 alec-c4

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

kirillplatonov avatar Jun 01 '22 09:06 kirillplatonov

I use esbuild :)

alec-c4 avatar Jun 01 '22 15:06 alec-c4

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

elik-ru avatar Feb 21 '23 23:02 elik-ru

@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")
  ]

LEstradioto avatar Feb 23 '23 04:02 LEstradioto

@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.

elik-ru avatar Feb 23 '23 08:02 elik-ru

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

kirillplatonov avatar Mar 19 '23 07:03 kirillplatonov