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
Copy file name to clipboardExpand all lines: docs/metro.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Configuration options for Metro can be customized in your project's `metro.confi
16
16
Please see [**Configuring Metro**](https://facebook.github.io/metro/docs/configuration) on the Metro website for documentation on all available config options.
17
17
:::
18
18
19
-
In React Native, your Metro config should extend either [@react-native/metro-config](https://www.npmjs.com/package/@react-native/metro-config) or [@expo/metro-config](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps.
19
+
In React Native, your Metro config should extend either [`@react-native/metro-config`](https://www.npmjs.com/package/@react-native/metro-config) or [`@expo/metro-config`](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps.
20
20
21
21
Below is the default `metro.config.js` file in a React Native template project:
Metro options you wish to customize can be done so within the `config` object. We strongly recommend defining all config values statically within this file.
38
+
Metro options you wish to customize can be done so within the `config` object.
39
39
40
40
### Advanced: Using a config function
41
41
42
42
Exporting a config function is an opt-in to managing the final config yourself — **Metro will not apply any internal defaults**. This pattern can be useful when needing to read the base default config object from Metro or to set options dynamically.
43
43
44
44
:::info
45
-
**From @react-native/metro-config`0.72.1`**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below.
45
+
**From `@react-native/metro-config`0.72.1**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below.
46
46
:::
47
47
48
48
<!-- prettier-ignore -->
@@ -66,7 +66,7 @@ module.exports = function (baseConfig) {
66
66
```
67
67
68
68
:::tip
69
-
Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from **@react-native/metro-config**.
69
+
Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from `@react-native/metro-config`.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-0.72/metro.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Configuration options for Metro can be customized in your project's `metro.confi
16
16
Please see [**Configuring Metro**](https://facebook.github.io/metro/docs/configuration) on the Metro website for documentation on all available config options.
17
17
:::
18
18
19
-
In React Native, your Metro config should extend either [@react-native/metro-config](https://www.npmjs.com/package/@react-native/metro-config) or [@expo/metro-config](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps.
19
+
In React Native, your Metro config should extend either [`@react-native/metro-config`](https://www.npmjs.com/package/@react-native/metro-config) or [`@expo/metro-config`](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps.
20
20
21
21
Below is the default `metro.config.js` file in a React Native template project:
Metro options you wish to customize can be done so within the `config` object. We strongly recommend defining all config values statically within this file.
38
+
Metro options you wish to customize can be done so within the `config` object.
39
39
40
40
### Advanced: Using a config function
41
41
42
42
Exporting a config function is an opt-in to managing the final config yourself — **Metro will not apply any internal defaults**. This pattern can be useful when needing to read the base default config object from Metro or to set options dynamically.
43
43
44
44
:::info
45
-
**From @react-native/metro-config`0.72.1`**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below.
45
+
**From `@react-native/metro-config`0.72.1**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below.
46
46
:::
47
47
48
48
<!-- prettier-ignore -->
@@ -66,7 +66,7 @@ module.exports = function (baseConfig) {
66
66
```
67
67
68
68
:::tip
69
-
Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from **@react-native/metro-config**.
69
+
Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from `@react-native/metro-config`.
0 commit comments