Skip to content

Add genType module config #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pages/docs/gentype/latest/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Add a `gentypeconfig` section to your `bsconfig.json` (See [Configuration](#conf
"language": "typescript",
"shims": {},
"generatedFileExtension": ".gen.tsx",
"module": "es6",
"debug": {
"all": false,
"basic": false
Expand All @@ -51,6 +52,7 @@ structure:
"gentypeconfig": {
"language": "typescript" | "flow" | "untyped",
"generatedFileExtension": ".gen.tsx",
"module": "es6" | "commonjs",
"shims": {
"ReasonReact": "ReactShim"
}
Expand All @@ -64,6 +66,9 @@ structure:
- `"typescript"` : Generate `*.gen.tsx` files written in TypeScript.
- `"flow"`: Generate `*.gen.js` files with Flow type annotations.
- `"untyped"`: Generate `*.gen.js` files in vanilla JavaScript.

- **module**
- Module format used for the generated `*.gen.tsx` files (supports `"es6"` and `"commonjs"`)

- **shims**
- 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.
Expand Down