diff --git a/README.md b/README.md index 098d539..7cb2f27 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ On larger projects this means spring will be more responsive, more accurate and Listen 2.7 and higher and 3.0 are supported. If you rely on Listen 1 you can use v1.0.0 of this gem. +## Environment variables + +* `DISABLE_SPRING_WATCHER_LISTEN` - If set, this disables the loading of this gem. This can be useful for projects where + some configurations do not support inotify (e.g. Docker on M1 Macs). + ## Installation Stop Spring if it's already running: diff --git a/lib/spring/watcher/listen.rb b/lib/spring/watcher/listen.rb index a925540..3e14e04 100644 --- a/lib/spring/watcher/listen.rb +++ b/lib/spring/watcher/listen.rb @@ -1,3 +1,5 @@ +return if ENV['DISABLE_SPRING_WATCHER_LISTEN'] + require "spring/watcher" require "spring/watcher/abstract"