Skip to content

Instantly share code, notes, and snippets.

@wende
Created November 28, 2017 21:27
Show Gist options
  • Save wende/62399be4c0e9c1e41e272cdae7b5b8a7 to your computer and use it in GitHub Desktop.
Save wende/62399be4c0e9c1e41e272cdae7b5b8a7 to your computer and use it in GitHub Desktop.
defmodule ElchemyDeps do
def init(project, {__MODULE, _}) do
# We don't need additional elixirc paths, and elchemy paths should be
# configurable by the user (and there already is a default value)
project
|> put_in(:compilers, [:elchemy | (project[:compilers] || [])])
|> put_in(:deps, project[:deps] ++ deps())
end
def deps do
[] # Required elchemy paths (like Poison and whatnot)
++ [] # Get deps from the elm-package.json, and recursively do the same
end
end
ElchemyDeps
# In mix.exs do:
# deps: deps()] |> Code.eval_file("elchemy.exs").init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment