XUtils

Elm + Phoenix + Webpack

A minimal Elm + Phoenix setup, using webpack instead of Brunch.


FEATURES

BACKEND:
Basically just $ mix phx.new foo --no-brunch, with changes made to ./lib/foo/web/templates/layout/app.html.eex and ./lib/foo/web/templates/page/index.html.eex to load up the Elm app.
FRONTEND:
All related files are found in ./assets, including package.json, elm-package.json and webpack.config.js. Therefore npm install and elm-package install will have to be run from there.
SCRIPTS:
As a convenience due to the location of package.json, I have added a custom mix task (./lib/mix/npm.ex) which allows the execution of npm run scripts from the project root using mix: mix npm build, mix npm watch, etc.


Articles

  • coming soon...