Automatically reload code in non-Phoenix projects?

The current approach I found is this:

.iex.exs:

IEx.configure(auto_reload: true)

Terminal Tab 1:

iex -S mix

Terminal Tab 2:

fswatch -o lib | xargs -n1 -I{} mix compile

Any simpler ways?

(as in “hot-reloading” for development only)

recompile in an iex session?

Sounds like I would need to run it every time, which isn’t really automatic. But yeah, it’s definitely an alternative :+1:

You could probably write something to do this yourself, the Phoenix live reloader isn’t super complicated phoenix_live_reload/lib/phoenix_live_reload/live_reloader.ex at main · phoenixframework/phoenix_live_reload · GitHub