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
<p>First, it installs <code>bs-platform</code> globally, then we use the command line tool <code>bsb</code> to set up a sample project named <code>hello</code>, then we run the build.</p>
1077
+
</div>
1078
+
<divclass="paragraph">
1079
+
<p>The output project layout is similar as below</p>
<p>To enter watch mode, you can run <code>npm run watch</code>,
1098
+
then you can edit <code>src/demo.ml</code> and see it compiled on the fly, and changes are updated on <code>lib/js/src/demo.js</code></p>
1099
+
</div>
1100
+
<divclass="paragraph">
1101
+
<p>If you happen to use VSCode as editor, we provide <code>.vscode/tasks.json</code> as well, type <code>Tasks>build</code>, it will enter watch mode, the great thing is that VSCode comes with
1102
+
a <code>Problems</code> panel which has a much nicer UI.</p>
1103
+
</div>
1104
+
<divclass="paragraph">
1105
+
<p>Currently there are not too many project templates, you can contribute more project templates here <ahref="https://github.com/bloomberg/bucklescript/tree/master/jscomp/bsb/templates">here</a>,</p>
1106
+
</div>
1107
+
</div>
1108
+
<divclass="sect2">
1109
+
<h3id="_first_example_by_hand_without_samples"><aclass="anchor" href="#_first_example_by_hand_without_samples"></a>First example by hand without samples</h3>
Copy file name to clipboardExpand all lines: site/docsource/Get_started.adoc
+37-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,42 @@
1
1
## Get Started
2
2
3
-
### First example
3
+
### Using existing templates (@since 1.7.4 )
4
+
5
+
BuckleScript provide some project templates, to help people get started on board as fast as possible.
6
+
7
+
[source,sh]
8
+
--------------
9
+
npm install -g bs-platform && bsb -init hello && cd hello && npm run build
10
+
--------------
11
+
12
+
First, it installs `bs-platform` globally, then we use the command line tool `bsb` to set up a sample project named `hello`, then we run the build.
13
+
14
+
The output project layout is similar as below
15
+
16
+
[source,sh]
17
+
-----------
18
+
hello>tree -d .
19
+
.
20
+
|---.vscode
21
+
├── lib
22
+
│ ├── bs
23
+
│ │ └── src
24
+
│ └── js
25
+
│ └── src
26
+
├── node_modules
27
+
│ └── bs-platform -> ...
28
+
└── src
29
+
-----------
30
+
31
+
To enter watch mode, you can run `npm run watch`,
32
+
then you can edit `src/demo.ml` and see it compiled on the fly, and changes are updated on `lib/js/src/demo.js`
33
+
34
+
If you happen to use VSCode as editor, we provide `.vscode/tasks.json` as well, type `Tasks>build`, it will enter watch mode, the great thing is that VSCode comes with
35
+
a `Problems` panel which has a much nicer UI.
36
+
37
+
Currently there are not too many project templates, you can contribute more project templates here https://github.com/bloomberg/bucklescript/tree/master/jscomp/bsb/templates[here],
38
+
39
+
### First example by hand without samples
4
40
5
41
* Create a directory called `hello` and create `bsconfig.json` and `package.json`
0 commit comments