Packages

This is a CMS written in Elixir. Aims to be the great open-source ecommerce and/or startup solution for those who are searching for a performance and stability on top of modern technologies like React and Elixir.

Current section

Files

Jump to
lyn lib mix tasks webpack.compile.ex
Raw

lib/mix/tasks/webpack.compile.ex

defmodule Mix.Tasks.Webpack.Compile do
@shortdoc "Compiles Webpack"
@webpack "../node_modules/webpack/bin/webpack.js"
def run(_) do
{_res,0} = compile_server
{json,0} = compile_client
File.write!("priv/webpack.stats.json",json)
end
def compile_server() do
server_config = "../node_modules/reaxt/server.webpack.config.js"
System.cmd("node",[@webpack,"--config",server_config,"--colors"], into: IO.stream(:stdio, :line), cd: WebPack.Util.web_app)
end
def compile_client() do
client_config = "../node_modules/reaxt/client.webpack.config.js"
System.cmd("node",[@webpack,"--config",client_config,"--json"], into: "", cd: WebPack.Util.web_app)
end
end