Skip to content

Commit 62c0f34

Browse files
committed
docs: re-order export conditions
1 parent ee62040 commit 62c0f34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/pages/esm.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (Rea
200200
"types": "./lib/typescript/module/src/index.d.ts",
201201
"default": "./lib/module/index.native.js"
202202
},
203-
"module": {
203+
"node": {
204204
"types": "./lib/typescript/module/src/index.d.ts",
205205
"default": "./lib/module/index.js"
206206
},
207-
"node": {
207+
"module": {
208208
"types": "./lib/typescript/module/src/index.d.ts",
209209
"default": "./lib/module/index.js"
210210
},
@@ -221,8 +221,8 @@ For example, here is a setup that uses ESM for Webpack, Vite, Rollup, Metro (Rea
221221
Here, we specify 4 conditions:
222222

223223
- `react-native`: Used when the library is imported in a React Native environment with Metro.
224-
- `module`: Used when the library is imported in a bundler such as Webpack, Vite or Rollup.
225224
- `node`: Used when the library is imported in Node.js.
225+
- `module`: Used when the library is imported in a bundler such as Webpack, Vite or Rollup.
226226
- `default`: Fallback used when the library is imported in an environment that doesn't support the other conditions.
227227

228228
One thing to note is that TypeScript may need to be configured to resolve to the appropriate condition. It's pre-configured for React Native apps, but in other scenarios, it maybe necessary to specify [`customConditions`](https://www.typescriptlang.org/tsconfig/#customConditions) in the `tsconfig.json` file:

0 commit comments

Comments
 (0)