elm_compile v0.2.0 mix compile.elm
Performs compilation and staging of Elm assets. Requires an elm-lang installation, see: https://guide.elm-lang.org/install.html
The elm compiler task accepts the following options:
src_dir
: Location of the Elm assets to be compiled. Default:web
main_module
: The name of the main Elm module. Default:Main.elm
compiler_arguments
: Arguments passed to the Elm compiler. Default:--outputelm.js
destination_dir
: Location where the compiled Elm assets will be placed. Default:priv/static
assets_to_stage
: List of files and dirs to move to thedestination_dir
after the elm compiler finishes. Default:[elm.js]
Example:
def project do
[app: :my_app,
version: "1.0.0",
elixir: "~> 1.7",
elm: [
src_dir: "src",
destination_dir: "public",
compiler_arguments: ["--output", "main.js", "--debug"],
assets_to_stage: ["index.html", "main.js", "styles/", "resources/"]
],
deps: deps()]
end
Link to this section Summary
Functions
Receives command-line arguments and performs compilation. If it produces errors, warnings, or any other diagnostic information, it should return a tuple with the status and a list of diagnostics
Link to this section Types
step_result()
step_result() :: :ok | {:error, [String.t()]}
step_result() :: :ok | {:error, [String.t()]}
Link to this section Functions
merge_config(config)
merge_config(Keyword.t()) :: step_result()
merge_config(Keyword.t()) :: step_result()
run(args)
run([String.t()]) :: step_result()
run([String.t()]) :: step_result()
Receives command-line arguments and performs compilation. If it produces errors, warnings, or any other diagnostic information, it should return a tuple with the status and a list of diagnostics.
Callback implementation for Mix.Task.Compiler.run/1
.