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
feat(nextjs): Add options to disable webpack plugin (getsentry#3771)
Despite our strong encouragement, not everyone wants to use the `SentryWebpackPlugin` to upload sourcemaps. This PR introduces two new options, `disableServerWebpackPlugin` and `disableClientWebpackPlugin`, which can be used in `next.config.js` like this:
```
const { withSentryConfig } = require("@sentry/nextjs");
const moduleExports = {
sentry: {
disableServerWebpackPlugin: true,
disableClientWebpackPlugin: true,
},
};
// unnecessary if the webpack plugin is disabled for both server and client (in that case, can also safely
// be omitted from the `withSentryConfig` call below)
const SentryWebpackPluginOptions = {
// ...
};
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
```
Setting either of these options does two things in the relevant (server or client) config:
- prevents the SDK from forcing `webpack.devtool` to be `source-map` in production, and
- prevents the SDK from adding an instance of `SentryWebpackPlugin` to the webpack config.
These changes are documented in getsentry/sentry-docs#3826.
Fixesgetsentry#3674
0 commit comments