I have elm reactor
serving my pages while developing. After saving my code changes, I am running elm make src/Main.elm --output=main.js
. Is there a way to auto elm make
on save and see the changes on the browser?
I'm using elm 0.19
Update for 2021: These days I would just use Parcel JS. It support hot reloading and is easy to setup in general: https://parceljs.org/elm.html
Old answer: I had the same issue.
At first I used a custom script in my Atom environment, but then I found Elm Live: https://github.com/wking-io/elm-live.
Does all you ask. Highly recommended! Automatically recompiles, hot reloads and opens the browser window if not opened.
First install with NPM: (I used some issues with the latest
version)
npm install --save-dev elm elm-live
Then use the command instead of the one you're using now:
elm-live src/Main.elm --open -- --output=main.js
I think you'll need to use a proper build environment to get hot reloading. The one I created and use is at https://github.com/simonh1000/elm-webpack-starter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With