Require local package in mix.exs
In Elixir as you are writing your application it is recommended to split parts of it into smaller applications (also can be called micro-services if you want to be buzzword compliant).
You don't however need to publish those dependencies to the Hex package manager in order to load them, instead you can use the path
argument when defining a dependency.
In this example we have our main application Foo
and in the directory above it we have an application called Bar
.
To make the Bar
module available in Foo
we can do it like so:
mix.exs
defp deps do
[
{:bar, path: "../bar"},
]
end
Tweet