Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/platforms/react-native/manual-setup/metro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ const config = getSentryExpoConfig(__dirname, {

### Reduce Bundle Size

If you're not targeting React Native for Web, you can exclude web-only packages like Session Replay from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.
If you're not targeting React Native for Web, you can exclude web-only packages like Session Replay and User Feedback from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.

| Option | Default | Effect when set to `false` |
| --------------------- | ------- | ------------------------------------------------------------------------ |
| `includeWebReplay` | `true` | Excludes `@sentry/replay` and `@sentry-internal/replay` from the bundle. |
| `includeWebFeedback` | `true` | Excludes `@sentry-internal/feedback` from the bundle. |

Note that these options only affect bundling. They do not disable the corresponding native (Android/iOS) integrations.

Expand All @@ -89,6 +90,7 @@ const { withSentryConfig } = require("@sentry/react-native/metro");
const config = getDefaultConfig(__dirname);
module.exports = withSentryConfig(config, {
includeWebReplay: false,
includeWebFeedback: false,
});
```

Expand All @@ -97,6 +99,7 @@ const { getSentryExpoConfig } = require("@sentry/react-native/metro");

const config = getSentryExpoConfig(__dirname, {
includeWebReplay: false,
includeWebFeedback: false,
});
```

Expand Down
Loading