sentry-javascript
sentry-javascript copied to clipboard
feat(nextjs): added webpack treeshaking flags as config
This PR updates the Sentry Next.js integration to improve tree-shaking configuration and add new options for finer control over what SDK code is included in the final bundle.
The most significant changes are:
- Added several new tree-shaking flags for better user DX.
Closes #18417
size-limit report 📦
| Path | Size | % Change | Change |
|---|---|---|---|
| @sentry/browser | 24.81 kB | - | - |
| @sentry/browser - with treeshaking flags | 23.3 kB | - | - |
| @sentry/browser (incl. Tracing) | 41.55 kB | - | - |
| @sentry/browser (incl. Tracing, Profiling) | 46.16 kB | - | - |
| @sentry/browser (incl. Tracing, Replay) | 79.97 kB | - | - |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags | 69.7 kB | +0.01% | +1 B 🔺 |
| @sentry/browser (incl. Tracing, Replay with Canvas) | 84.65 kB | - | - |
| @sentry/browser (incl. Tracing, Replay, Feedback) | 96.89 kB | - | - |
| @sentry/browser (incl. Feedback) | 41.52 kB | - | - |
| @sentry/browser (incl. sendFeedback) | 29.49 kB | +0.01% | +1 B 🔺 |
| @sentry/browser (incl. FeedbackAsync) | 34.48 kB | +0.01% | +1 B 🔺 |
| @sentry/react | 26.52 kB | - | - |
| @sentry/react (incl. Tracing) | 43.76 kB | - | - |
| @sentry/vue | 29.27 kB | - | - |
| @sentry/vue (incl. Tracing) | 43.36 kB | - | - |
| @sentry/svelte | 24.82 kB | - | - |
| CDN Bundle | 27.23 kB | - | - |
| CDN Bundle (incl. Tracing) | 42.22 kB | - | - |
| CDN Bundle (incl. Tracing, Replay) | 78.75 kB | +0.01% | +1 B 🔺 |
| CDN Bundle (incl. Tracing, Replay, Feedback) | 84.2 kB | - | - |
| CDN Bundle - uncompressed | 80.02 kB | - | - |
| CDN Bundle (incl. Tracing) - uncompressed | 125.37 kB | - | - |
| CDN Bundle (incl. Tracing, Replay) - uncompressed | 241.41 kB | - | - |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed | 254.17 kB | - | - |
| @sentry/nextjs (client) | 45.98 kB | - | - |
| @sentry/sveltekit (client) | 41.93 kB | - | - |
| @sentry/node-core | 51.6 kB | - | - |
| @sentry/node | 161.48 kB | +0.01% | +1 B 🔺 |
| @sentry/node - without tracing | 93.03 kB | - | - |
| @sentry/aws-serverless | 108.54 kB | -0.01% | -1 B 🔽 |
@logaretm make sure to add a section in the changelog for this 🙏