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: docs/rescript.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
> **Note:** ReScript support is currently available in `2.0.0-beta.0` or later.
2
-
>
2
+
>
3
3
> Please install it with `npm install -g @ocsigen/ts2ocaml@beta`.
4
4
5
5
# ts2ocaml for ReScript
@@ -18,6 +18,20 @@ The documentation for the `ts2ocaml` command and its options comes after the wal
18
18
19
19
`ts2ocaml` targets ReScript v11 or later.
20
20
21
+
Also, `ts2ocaml` depends on ReScript's new standard library `Core`.
22
+
You may need to add `@rescript/core` to your project dependencies (`dependencies` in `package.json` and `bs-dependencies` in `rescript.json`).
23
+
Please see [ReScript's official documentation](https://rescript-lang.org/docs/manual/latest/api) for details.
24
+
25
+
> Every code generated by `ts2ocaml` explicitly opens `RescriptCore`, so you don't have to set
26
+
>
27
+
> ```json
28
+
> "bsc-flags": [
29
+
> "-open RescriptCore"
30
+
> ]
31
+
> ```
32
+
>
33
+
> in your `rescript.json`.
34
+
21
35
## Adding `ts2ocaml.res`
22
36
23
37
ReScript has a rich standard library to use JS and DOM APIs and `ts2ocaml` makes use of it as much as possible. In addition to that, `ts2ocaml` uses a small standard library to handle some TypeScript-specific concepts:
@@ -82,7 +96,7 @@ let result = Ts.transpileModule(
0 commit comments