ExRerun

Status

Build Status

Recompiles mix project on any change to the project src files.

The initial version of this project is inspired by the - currently unmaintained - remix project by AgilionApps: https://github.com/AgilionApps/remix

Installation

Install ex_rerun by adding it as a dependency to mix.exs.

def deps do
  [{:ex_rerun, "~> 0.3", only: :dev}]
end

If developing a cmd line tool or similar project that does not involve a running process/server, using mix run --no-halt or iex -S mix still works for keeping the ex_rerun process alive to monitor and recompile / retest your code.

Configuration

It is possible to configure ex_rerun using the following parameters:

Note: the example below shows the default values.

config :ex_rerun,
  scan_interval: 4000,
  silent: false,
  file_types: [".ex", ".exs", ".eex", ".json"],
  paths: ["lib", "priv"],
  ignore_pattern: nil,
  tasks: [:elixir]

where:

Furthermore, tasks can also include custom mix tasks. For example, the hex package elm_compile defines the Mix.Tasks.Compile.Elm task which allows mix to also compile Elm files in a mix project. An example project config using ex_rerun and elm_compile might look like so:

config :ex_rerun,
  file_types: [".elm", ".ex", ".exs", ".eex", ".json"],
  paths: ["lib", "priv", "web"],
  tasks: [:elixir, Mix.Tasks.Compile.Elm]

Another example of a custom mix task could be to generate API documentation for a project based on a set of RAML files.