MjmlEEx.Compilers.Node (MJML EEx v0.13.0)
View SourceThis module implements the MjmlEEx.Compiler behaviour
and allows you to compile your MJML templates using the Node
CLI tool. This compiler expects you to have the mjml Node
script accessible from the running environment.
For information regarding the Node mjml compiler see: https://documentation.mjml.io/#command-line-interface
Configuration
In order to use this compiler, you need to set your application
configration like so (in your config.exs file for example):
config :mjml_eex,
compiler: MjmlEEx.Compilers.Node,
compiler_opts: [
timeout: 10_000,
path: "mjml"
]In addition, since the Node compiler is run via :erlexec, you will
need to add this optional dependency to your mix.exs file and also
start the optional application:
def application do
[
extra_applications: [..., :erlexec]
]
end
defp deps do
[
...
{:erlexec, "~> 2.0"}
]
end