You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GettingStarted.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,26 @@ elixirscript also takes a path to your `.ex` files as well:
48
48
49
49
If you look in the dist folder you'll see a file called `Elixir.App.js`
50
50
51
+
To start your application import the bundle according to whichever module format was selected and
52
+
then call start giving it the module and the initial args.
53
+
54
+
Ex. If you have a module like so
55
+
```elixir
56
+
defmoduleExampledo
57
+
start(type, args) do
58
+
:console.log("Hello, world")
59
+
end
60
+
end
61
+
```
62
+
63
+
You would start it like so
64
+
65
+
```javascript
66
+
//ES module example
67
+
importElixirfrom'./Elixir.App'
68
+
Elixir.start(Elixir.Example, [])
69
+
```
70
+
51
71
### Mix dependency
52
72
53
73
Adding Elixirscript to your mix project gives you the ability to add it to your list of mix compilers. This means when you `mix compile`, Elixirscript will compile your code as well.
0 commit comments