When “iex” is started by itself, then the code loader properly loads all paths stated in ERL_LIBS environment variable.
However, when you execute iex -S mix, then no library paths defined in ERL_LIBS are added. Is this a bug/feature? Is there an option to preserve ERL_LIBS variable checking by the code loader when the mix application is started?
ERL_AFLAGS should work. Mix prune code paths though, you can disable it with prune_code_paths: false in def project, but it will slow down compilation.