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
With the instructions below, our new standard library [ReScript Core](https://github.com/rescript-association/rescript-core) will be included by default. (In ReScript 11, it comes as a separate npm package `@rescript/core`. In future versions, it will be included in the `rescript` npm package itself.)
12
+
9
13
## Prerequisites
10
14
11
15
-[Node.js](https://nodejs.org/) version >= 14
12
-
- One of the following package managers
16
+
- One of the following package managers:
13
17
-[npm](https://docs.npmjs.com/cli/) (comes with Node.js)
14
18
-[yarn](https://yarnpkg.com/)
15
19
-[pnpm](https://pnpm.io/)
@@ -49,7 +53,9 @@ bun create rescript-app
49
53
node src/Demo.res.js
50
54
```
51
55
52
-
That compiles your ReScript into JavaScript, then uses Node.js to run said JavaScript. **We recommend you use our unique workflow of keeping a tab open for the generated `.res.js` file**, so that you can learn how ReScript transforms into JavaScript. Not many languages output clean JavaScript code you can inspect and learn from!
56
+
That compiles your ReScript into JavaScript, then uses Node.js to run said JavaScript.
57
+
58
+
**When taking your first steps with ReScript, we recommend you use our unique workflow of keeping a tab open for the generated JS file** (`.res.js`/`.res.mjs`), so that you can learn how ReScript transforms into JavaScript. Not many languages output clean JavaScript code you can inspect and learn from! With our [VS Code extension](https://marketplace.visualstudio.com/items?itemName=chenglou92.rescript-vscode), use the command "ReScript: Open the compiled JS file for this implementation file" to open the generated JS file for the currently active ReScript source file.
53
59
54
60
During development, instead of running `npm run res:build` each time to compile, use `npm run res:dev` to start a watcher that recompiles automatically after file changes.
55
61
@@ -87,16 +93,16 @@ bun create rescript-app
87
93
<CodeTablabels={["npm", "yarn", "pnpm", "bun"]}>
88
94
89
95
```sh
90
-
npm install rescript
96
+
npm install rescript @rescript/core
91
97
```
92
98
```sh
93
-
yarn add rescript
99
+
yarn add rescript @rescript/core
94
100
```
95
101
```sh
96
-
pnpm install rescript
102
+
pnpm install rescript @rescript/core
97
103
```
98
104
```sh
99
-
bun install rescript
105
+
bun install rescript @rescript/core
100
106
```
101
107
102
108
</CodeTab>
@@ -117,15 +123,20 @@ bun create rescript-app
117
123
}
118
124
],
119
125
"suffix": ".res.js",
120
-
"bs-dependencies": []
126
+
"bs-dependencies": [
127
+
"@rescript/core"
128
+
],
129
+
"bsc-flags": [
130
+
"-open RescriptCore"
131
+
]
121
132
}
122
133
```
123
134
See [Build Configuration](build-configuration) for more details on `rescript.json`.
124
135
- Add convenience `npm` scripts to `package.json`:
0 commit comments