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
To tree-shake Sentry debug code in Next.js projects, you can use webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/). The following Next.js configuration will replace all occurrences of `__SENTRY_DEBUG__` in your bundles with `false`:
459
+
460
+
```javascript {filename:next.config.js}
461
+
constnextConfig= {
462
+
webpack: (config, { webpack }) => {
463
+
config.plugins.push(
464
+
newwebpack.DefinePlugin({
465
+
__SENTRY_DEBUG__:false,
466
+
})
467
+
);
468
+
469
+
// return the modified config
470
+
return config;
471
+
},
472
+
};
473
+
```
474
+
475
+
For more information on custom webpack configurations in Next.js see [Custom Webpack Config](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config) in the Next.js docs.
0 commit comments