Elm 0.19.1 + Webpack 4 with hot-reloading! (Includes Babel for port code; CI script)
Elm dev environment with hot-loading (i.e. state is retained as you edit your code - Hot Module Reloading, HMR)). I use this daily for my professional work. Like elm-community/elm-webpack-starter but using Webpack 4.
Clone this repo into a new project folder and run install script. (You will probably want to delete the .git/ directory and start version control afresh.)
$ git clone [email protected]:simonh1000/elm-webpack-starter.git new-project $ cd new-project $ npm install
Start with Elm debug tool with either
sh $ npm start or $ npm start --nodebug
--nodebugremoves the Elm debug tool. This can become valuable when your model becomes very large.
Open http://localhost:3000 and start modifying the code in /src. Note that this starter expects you have installed elm-format globally.
An example using Routing is provided in the
Build production assets (js and css together) with:
npm run prod
Just add to
src/assets/and the production build copies them to
elm-test initis run when you install your dependencies. After that all you need to do to run the tests is
Take a look at the examples in
If you add dependencies to your main app, then run
Elm-analyse is a "tool that allows you to analyse your Elm code, identify deficiencies and apply best practices." Its built into this starter, just run the following to see how your code is getting on:
$ npm run analyse
$ circleci local execute --job build
This starter includes Babel so you can directly use ES6 code.
## How it works
npm run devmaps to
webpack-dev-server --hot --colors --port 3000where
--hotEnable webpack's Hot Module Replacement feature
--port 3000- use port 3000 instead of default 8000
--colorsshould show the colours created in the original Elm errors, but does not (To Fix)
One alternative is to run
npx webpack-dev-server --hot --colors --host=0.0.0.0 --port 3000which will enable your dev server to be reached from other computers on your local network
A long time ago this code was forked from https://github.com/fluxxu/elm-hot-loader