Skip to content

Commit 8cf68b8

Browse files
authored
Add genType module config (#436)
1 parent fa8714b commit 8cf68b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pages/docs/gentype/latest/getting-started.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Add a `gentypeconfig` section to your `bsconfig.json` (See [Configuration](#conf
2929
"language": "typescript",
3030
"shims": {},
3131
"generatedFileExtension": ".gen.tsx",
32+
"module": "es6",
3233
"debug": {
3334
"all": false,
3435
"basic": false
@@ -51,6 +52,7 @@ structure:
5152
"gentypeconfig": {
5253
"language": "typescript" | "flow" | "untyped",
5354
"generatedFileExtension": ".gen.tsx",
55+
"module": "es6" | "commonjs",
5456
"shims": {
5557
"ReasonReact": "ReactShim"
5658
}
@@ -64,6 +66,9 @@ structure:
6466
- `"typescript"` : Generate `*.gen.tsx` files written in TypeScript.
6567
- `"flow"`: Generate `*.gen.js` files with Flow type annotations.
6668
- `"untyped"`: Generate `*.gen.js` files in vanilla JavaScript.
69+
70+
- **module**
71+
- Module format used for the generated `*.gen.tsx` files (supports `"es6"` and `"commonjs"`)
6772

6873
- **shims**
6974
- Required only if one needs to export certain basic ReScript data types to JS when one cannot modify the sources to add annotations (e.g. exporting ReScript lists), and if the types are not first-classed in genType.

0 commit comments

Comments
 (0)