How to use an app as a dependency and reuse its config?

So what’s the issue with this? Seems to work just fine

b/config/config.exs

import Config

import_config "../../a/config/config.exs"

b/mix.exs

  defp deps do
    [
      {:a, path: "../a"}
    ]
  end

If somewhere in A I am using for example Application.fetch_env!(:a, :x), then it works just fine when A is started both directly and as dependency of B. And B expectedly fails when I remove that import from its config