I have created a project to reproduce the problem:
It’s an umbrella app with one app (a phoenix app). There is a config
config :hello,
enable_endpoint: true
and a router which consumes that config
if HelloWeb.Config.enable_endpoint() do
get "/toggled_endpoint", PageController, :toggled_endpoint
end
and it basically works.
The problem is, that if i switch the flag to false
and restart the server, the endpoint is still there. I have to modify router.ex
(e.g. add an empty line) so mix picks up the change and recompiles everything.
I already have an answer to the problem, which is the @external_resource
annotation (https://hexdocs.pm/elixir/Module.html#module-external_resource).
What confuses me though is, that according to the following comment, the project should recompile on changes to config: Mix will not recompile the app when change the "config.exs" in umbrella.
Am i missing something?