Skip to content
This repository was archived by the owner on Feb 9, 2021. It is now read-only.

Commit 3d79d4b

Browse files
committed
Elm front-end setup
1 parent 662a7d3 commit 3d79d4b

File tree

8 files changed

+872
-113
lines changed

8 files changed

+872
-113
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ npm-debug.log
4040
# secrets files as long as you replace their contents by environment
4141
# variables.
4242
/config/*.secret.exs
43+
44+
# Elm
45+
/assets/elm/elm-stuff

assets/elm/elm.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"type": "application",
3+
"source-directories": [
4+
"src"
5+
],
6+
"elm-version": "0.19.0",
7+
"dependencies": {
8+
"direct": {
9+
"elm/browser": "1.0.1",
10+
"elm/core": "1.0.2",
11+
"elm/html": "1.0.0"
12+
},
13+
"indirect": {
14+
"elm/json": "1.1.2",
15+
"elm/time": "1.0.0",
16+
"elm/url": "1.0.0",
17+
"elm/virtual-dom": "1.0.2"
18+
}
19+
},
20+
"test-dependencies": {
21+
"direct": {},
22+
"indirect": {}
23+
}
24+
}

assets/elm/src/Main.elm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Main exposing (main)
2+
3+
import Html exposing (Html, text)
4+
5+
6+
main : Html msg
7+
main =
8+
text "Hello from Elm inside Phoenix!"

assets/js/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ import "phoenix_html"
1515
//
1616
// Local files can be imported directly using relative paths, for example:
1717
// import socket from "./socket"
18+
19+
// Elm
20+
import { Elm } from "../elm/src/Main.elm"
21+
22+
Elm.Main.init({
23+
node: document.getElementById("elm-container")
24+
})

0 commit comments

Comments
 (0)