Skip to content

Commit 5effd26

Browse files
Update build-external-stdlib.mdx
Fixes: rescript-lang/rescript#6754
1 parent 19009b3 commit 5effd26

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

pages/docs/manual/latest/build-external-stdlib.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ To solve that, we now publish our runtime as a standalone package at [`@rescript
2424
Say you want to publish a JS-only ReScript 9.0 library. Install the packages like this:
2525

2626
```sh
27-
npm install [email protected] --save-dev
27+
npm install [email protected]
2828
npm install @rescript/[email protected]
2929
```
3030

31+
> Note: upcoming std version will contain the Core library, then `rescript` could be installed as a `--dev` dependencies.
32+
3133
Then add this to `rescript.json`:
3234

3335
```json
@@ -37,6 +39,21 @@ Then add this to `rescript.json`:
3739
}
3840
```
3941

42+
Make sure you are using commonjs because only `.mjs` files are published:
43+
44+
```json
45+
{
46+
// ...
47+
"package-specs": [
48+
{
49+
"module": "esmodule",
50+
"in-source": true
51+
}
52+
],
53+
"suffix": ".mjs",
54+
}
55+
```
56+
4057
Now the compiled JS code will import using the path defined by `external-stdlib`. Check the JS output tab:
4158

4259
<CodeTab labels={["ReScript", "JS output"]}>

0 commit comments

Comments
 (0)