feat(nextjs): Add option to use hidden-source-map
as webpack devtool
value
#4436
+29
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently force the value of the webpack option
devtool
to besource-map
, in order to guarantee that the correct sourcemaps are generated during build. There is anotherdevtool
value,hidden-source-map
, which produces the same maps (so just as good for our purposes), but without addingsourceMappingURL
comments at the bottom of the resulting JS files. (Some users prefer this as a way not to have the browser complain when it tries to follow thesourceMappingURL
link and comes up empty.)This PR adds an option that users can pass in their nextjs config, under the key
sentry.hideSourceMaps
. When this is set to true, the SDK will usehidden-source-map
as thedevtool
value instead ofsource-map
. Note that since this is a front-end-only problem, the option only applies to client-side builds.The new option is documented in getsentry/sentry-docs#4627.
Fixes #3549.