Skip to content

Commit 50fdf7f

Browse files
committed
docs: mention you need to export package.json
1 parent 49d767e commit 50fdf7f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/pages/build.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ yarn add --dev react-native-builder-bob
108108

109109
> If you're building TypeScript definition files, also make sure that the `types` field points to a correct path. Depending on the project configuration, the path can be different for you than the example snippet (e.g. `lib/typescript/index.d.ts` if you have only the `src` directory and `rootDir` is not set).
110110
111+
1. Export package.json if needed:
112+
113+
If you don't have `"includesGeneratedCode": true` in your `codegenConfig`, and you ship your native library for the new architecture, you also have to add `"./package.json": "./package.json"` into the `exports` field. Otherwise, React Native Codegen will skip spec generation for your library when your library is consumed as an NPM library. You can find the related issue [here](https://github.com/callstack/react-native-builder-bob/issues/637).
114+
115+
```json
116+
"exports": {
117+
// ...
118+
"./package.json": "./package.json"
119+
},
120+
```
121+
111122
1. Add the output directory to `.gitignore` and `.eslintignore`
112123

113124
```gitignore

0 commit comments

Comments
 (0)