elixir_script v0.30.0 mix compile.elixir_script View Source

Mix compiler to allow mix to compile Elixirscript source files into JavaScript

Looks for an elixir_script or elixirscript key in your mix project config

def project do
  [
    app: :my_app,
    version: "0.1.0",
    elixir: "~> 1.0",
    deps: deps,
    elixir_script: [ input: Example, output: "dest/js"],
    compilers: Mix.compilers ++ [:elixir_script]
  ]
end

Available options are:

  • input: The module or modules that are the entry to your application (required)

  • output: The path of the generated JavaScript file. (defaults to priv/elixir_script/build)

    If path ends in .js then that will be the name of the file. If a directory is given, file will be named elixirscript.build.js

  • root: Optional root for imports of FFI JavaScript modules. Defaults to .. If using output directly in a browser, you may want to make it something like /js or some uri.

The mix compiler will also compile any dependencies that have the elixirscript compiler in its mix compilers as well

Link to this section Summary

Functions

A task needs to implement run which receives a list of command line args

Link to this section Functions

A task needs to implement run which receives a list of command line args.

Callback implementation for Mix.Task.run/1.