You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`source`: The path to the source code. It is used by `react-native-builder-bob` to detect the correct output files and provide better error messages.
96
-
-`main`: The entry point for the commonjs build. This is used by Node - such as tests, SSR etc.
96
+
-`main`: The entry point for the CommonJS build. This is used by Node - such as tests, SSR etc.
97
97
-`module`: The entry point for the ES module build. This is used by bundlers such as webpack.
98
-
-`types`: The entry point for the TypeScript definitions. This is used by TypeScript to type check the code using your library.
98
+
-`types`: The entry point for the TypeScript definitions. This is used by TypeScript to typecheck the code using your library.
99
99
-`files`: The files to include in the package when publishing with `npm`.
100
100
-`exports`: The entry points for tools that support the `exports` field in `package.json` - such as Node.js 12+ & modern browsers.
101
101
@@ -156,7 +156,7 @@ Various targets to build for. The available targets are:
156
156
157
157
#### `commonjs`
158
158
159
-
Enable compiling source files with Babel and use commonjs module system.
159
+
Enable compiling source files with Babel and use CommonJS module system.
160
160
161
161
This is useful for running the code in Node (SSR, tests etc.). The output file should be referenced in the `main` field and `exports['.'].require` (when `esm: true`) field of `package.json`.
162
162
@@ -168,9 +168,9 @@ In addition, the following options are supported:
168
168
169
169
Setting this option to `true` will output ES modules compatible code for Node.js 12+, modern browsers and other tools that support `package.json`'s `exports` field.
170
170
171
-
This mainly adds file extensions to the imports and exports. Note that file extensions are not added when importing a file that may have platform-specific extensions (e.g. `.android.ts`). In addition, the generated files will have `.cjs` (commonjs) and `.mjs` (modules) extensions instead of `.js` - this is necessary to disambiguate between the two formats.
171
+
This mainly adds file extensions to the imports and exports. Note that file extensions are not added when importing a file that may have platform-specific extensions (e.g. `.android.ts`) to avoid breaking tools. In addition, the generated files will have `.cjs` (CommonJS) and `.mjs` (ES modules) extensions instead of `.js` - this is necessary to disambiguate between the two formats.
172
172
173
-
If you use TypeScript, also make sure to set `"moduleResolution": "Bundler"` in your `tsconfig.json` file. You may also need to set `"react/react-in-jsx-scope": "off"` if you're using ESLint with the React plugin.
173
+
If you use TypeScript, also make sure to set `"moduleResolution": "Bundler"` in your `tsconfig.json` file.
174
174
175
175
##### `configFile`
176
176
@@ -196,9 +196,9 @@ Example:
196
196
197
197
#### `module`
198
198
199
-
Enable compiling source files with Babel and use ES module system. This is essentially same as the `commonjs` target and accepts the same options, but leaves the `import`/`export` statements in your code.
199
+
Enable compiling source files with Babel and use ES module system. This is essentially the same as the `commonjs` target and accepts the same options, but leaves the `import`/`export` statements in your code.
200
200
201
-
This is useful for bundlers which understand ES modules and can tree-shake. The output file should be referenced in the `module` field and `exports['.'].import` (when `esm: true`) field of `package.json`.
201
+
This is useful for bundlers that understand ES modules and can tree-shake. The output file should be referenced in the `module` field and `exports['.'].import` (when `esm: true`) field of `package.json`.
0 commit comments