Skip to content

Commit ed2a30f

Browse files
committed
docs: add info about types field and fix typo
1 parent 62c0f34 commit ed2a30f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/pages/esm.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To make use of the output files, ensure that your `package.json` file contains t
4747
},
4848
```
4949

50-
The `main` field is for tools that don't support the `exports` field (e.g. [Metro](https://metrobundler.dev) < 0.82.0).
50+
The `main` field is for tools that don't support the `exports` field (e.g. [Metro](https://metrobundler.dev) < 0.82.0). The `types` field is for legacy TypeScript setups that use `moduleResolution: "node10"` or `moduleResolution: "node"`.
5151

5252
The `exports` field is used by Node.js 12+, modern browsers and tools to determine the correct entry point. The entrypoint is specified in the `.` key and will be used when the library is imported or required directly (e.g. `import 'my-library'` or `require('my-library')`).
5353

@@ -198,7 +198,7 @@ For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (Rea
198198
".": {
199199
"react-native": {
200200
"types": "./lib/typescript/module/src/index.d.ts",
201-
"default": "./lib/module/index.native.js"
201+
"default": "./lib/module/index.js"
202202
},
203203
"node": {
204204
"types": "./lib/typescript/module/src/index.d.ts",

0 commit comments

Comments
 (0)