Skip to content

Instantly share code, notes, and snippets.

@rtorr
Last active August 8, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rtorr/8c859bafbbf131463ced to your computer and use it in GitHub Desktop.
Save rtorr/8c859bafbbf131463ced to your computer and use it in GitHub Desktop.
Watch elm files for changes and then recompile
Watch elm files for changes and then recompile
brew install fswatch
make watch
js = $(shell echo $(elm) | tr A-Z a-z)
elm = Main
# Example: make elm=Main js=main watch
watch:
echo "watching *.elm files, outputing $(js).js" && fswatch -0 *.elm | xargs -0 -n 1 -I \{\} elm-make $(elm).elm --output $(js).js
# Example: make elm=Main js=main build
build:
elm-make $(elm).elm --output $(js).js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment