Last active
September 18, 2019 23:42
-
-
Save ni-ko-o-kin/9396247238d2a2e4b28f73a1147f246c to your computer and use it in GitHub Desktop.
use elm with meteor without a meteor package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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: {}, | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"scripts": { | |
"watch-elm": "sh ./private/watchelm.sh" | |
... | |
}, | |
... | |
"meteor": { | |
"mainModule": { | |
"client": "startup/client/main.js", | |
... | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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