Skip to content

Instantly share code, notes, and snippets.

@ni-ko-o-kin
Last active September 18, 2019 23:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ni-ko-o-kin/9396247238d2a2e4b28f73a1147f246c to your computer and use it in GitHub Desktop.
Save ni-ko-o-kin/9396247238d2a2e4b28f73a1147f246c to your computer and use it in GitHub Desktop.
use elm with meteor without a meteor package
// startup/client/main.js
import { Meteor } from 'meteor/meteor';
import '/elm-client/elm-main';
Meteor.startup(() => {
const app = Elm.Main.init({
node: document.getElementById('elm-root'),
flags: {},
});
});
{
...
"scripts": {
"watch-elm": "sh ./private/watchelm.sh"
...
},
...
"meteor": {
"mainModule": {
"client": "startup/client/main.js",
...
}
}
}
// private/watchElm.sh
cd elm-client
while inotifywait -e close_write -r src
do
clear
sleep 0.2
echo "\n"
elm make --debug src/Main.elm --output=elm-main.js
echo "\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment