Make `recompile` work with dependency

Hey,

I’ve got a project with several path dependencies. Some are phoenix apps, but this likely isn’t relevant.

I don’t fully understand the following behavior.

If I make a change in a file in a path dependency and run iex -S mix phx.server, the file is recompiled.

But if I make a change in a file in a path dependency while iex is already running, the file is not recompiled.

I know I can use r() on a particular module, but that’s not quite as convenient. Is there an easy way to get recompile to work on changed files in path dependencies?

Recompile does only ever recompile modules of the current application/project.

In my opinion, you should not rely on anything to recompile your dependencies, except for mix deps.compile --force.

You could try out exsync for your code reloading:

It will recompile path dependencies for you when you make the changes.

3 Likes