Elm reactor - init with flags for 0.19

Ah right, it also happened to me at first to overwrite my index.html by using the wrong arguments, that’s why I usually put my index.html in a subdirectory to avoid messing with it inadvertently, for example using ./public/index.html:

$ elm-live src/Main.elm -d public -- --output=public/elm.js

elm-live will serve ./public/index.html that must include elm.js and init the elm application. You can also put some css or other static files in public/. If you forgot the -- --output, the generated index.html will be in . and won’t overwrite your carefully crafted one (which is indeed annoying).

2 Likes