railsjazz / rails_live_reload

Live Reload for your Rails app. The easiest way to increase your productivity.
https://www.railsjazz.com/
MIT License
318 stars 8 forks source link

Allow configuring 'ignore:' option for the Listen gem #38

Open grncdr opened 4 weeks ago

grncdr commented 4 weeks ago

This code that sets up a listener is hardcoded to the Rails root.

https://github.com/railsjazz/rails_live_reload/blob/e089d818de02e8b10d94848ecfe09d4e8aad58a6/lib/rails_live_reload/watcher.rb#L28C1-L39C8

That's fine, but in my project there are some other folders that should not be watched because it causes a lot of CPU usage for the Listen gem. It would be nice if the configuration allowed adding ignore patterns like this:

config.ignore /^\./
config.ignore /node_modules/