Making Elixir Recompile When External Files Change
2025-03-18
![]()
This article delves into optimising the Elixir language to efficiently handle recompilation when external file changes occur. By offloading computations to compile time and using the @external_resource attribute, developers can ensure that modifications to files trigger recompilations automatically, without needing to manually force a recompilation of the entire project. Moreover, the blog introduces the mix_recompile?/0 function in Elixir 1.12 to fine-tune recompilation logic, accounting for changes in directory structure as well as content updates.
Was this useful?