ElixirScript acts as a mix compiler. This means that when you execute
mix, ElixirScript’s compiler will run as well. Make sure to add ElixirScript to your list of compilers in mix.exs.
ElixirScript must be told which modules to use as the entry to your ElixirScript application. This is done by adding an
elixir_script key to your project configuration whose value is a keyword list of options. Add an
priv/elixir_script/build. If you wish to change this, add an
output key to your ElixirScript configuration.
An example configuration for a project is shown below
# Add elixir_script as a compilter
compilers ++ [:elixir_script],
# Our elixir_script configuration
# Entry module. Can also be a list of modules
# Output path. Either a path to a js file or a directory
Available options are:
input(required): The entry module(s) for your application or library
If path ends in
.jsthen that will be the name of the file. If a directory is given, file will be named
.. If using output directly in a browser, you may want to make it something like
/jsor some uri.
elixirscript.build.js in the
const myInitialArgs = 
ElixirScript can use many of the same Hex packages and dependencies that currently exist. It is also possible to make packages that are specific to ElixirScript. If you decide to make such a package, please prepend
elixir_script to the app name. For instance is making a package for ElixirScript with FFI modules for interacting with React, the name would be
elixir_script_react. This is to make sure that other developers know that a package in Hex is specifically for use with ElixirScript.
ElixirScript does not support
receive or any of OTP at this time.
Elixir Script React
Creates a React Element
children = 
, props, children)
Renders a React Element to the given DOM container
Container is any value allowed by document.querySelector