From f6ea34adf5096c52d8e13c671a0041745ea3a5e3 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Fri, 21 Jan 2022 10:53:15 -0800 Subject: [PATCH 1/2] document `hideSourceMaps` option --- .../javascript/guides/nextjs/manual-setup.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/platforms/javascript/guides/nextjs/manual-setup.mdx b/src/platforms/javascript/guides/nextjs/manual-setup.mdx index 6d12d6c188327..00a84310a08f1 100644 --- a/src/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/src/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -194,6 +194,8 @@ By default, `withSentryConfig` will add an instance of `SentryWebpackPlugin` to To configure the plugin, pass a `SentryWebpackPluginOptions` argument to `withSentryConfig`, as seen in the example above. All available options are documented [here](https://github.com/getsentry/sentry-webpack-plugin#options). +### Disable `SentryWebpackPlugin` + If you want or need to handle source map uploading separately, the plugin can be disabled for either the server or client build process. To do this, add a `sentry` object to `moduleExports` above, and set the relevant options there: ```javascript {filename:next.config.js} @@ -213,6 +215,20 @@ module.exports = withSentryConfig(moduleExports); In that case you can also skip the `sentry-cli` configuration step below. +### Use `hidden-source-map` + +If you would like to use `hidden-source-map` rather than `souce-map` as your webpack `devtool`, so that your built files do not contain a `sourceMappingURL` comment, add a `sentry` object to `moduleExports` above, and set the `hideSourceMaps` option to `true`: + +```javascript {filename:next.config.js} +const moduleExports = { + sentry: { + hideSourceMaps: true, + }, +}; +``` + +Note that this only applies to client-side builds. + ## Configure `sentry-cli` The `SentryWebpackPlugin` uses `sentry-cli` to manage releases and source maps, which can be configured in one of two ways - using configuration files, or with environment variables - both of which are discussed below. For full details, see [the CLI configuration docs](/product/cli/configuration/). From 8e5487f17b6aa65cba7d725e214bcafcec7af761 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 24 Jan 2022 08:24:55 -0800 Subject: [PATCH 2/2] add version info Co-authored-by: Abhijeet Prasad --- src/platforms/javascript/guides/nextjs/manual-setup.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/javascript/guides/nextjs/manual-setup.mdx b/src/platforms/javascript/guides/nextjs/manual-setup.mdx index 00a84310a08f1..efd5d6304f324 100644 --- a/src/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/src/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -217,6 +217,9 @@ In that case you can also skip the `sentry-cli` configuration step below. ### Use `hidden-source-map` + +_(New in version 6.17.1)_ + If you would like to use `hidden-source-map` rather than `souce-map` as your webpack `devtool`, so that your built files do not contain a `sourceMappingURL` comment, add a `sentry` object to `moduleExports` above, and set the `hideSourceMaps` option to `true`: ```javascript {filename:next.config.js}