-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
5 / 55 of 5 issues completedDescription
Problem Statement
As identified in getsentry/sentry-docs#9557, we currently don't document that sourcemaps do not have to be shipped to production. It also shows that the nextjs SDK has an option hideSourceMaps
to hide source maps (albeit it not actually being used anywhere π
).
sentry-javascript/packages/nextjs/src/config/types.ts
Lines 376 to 380 in e5d1575
/** | |
* Use `hidden-source-map` for webpack `devtool` option, which strips the `sourceMappingURL` from the bottom of built | |
* JS files. | |
*/ | |
hideSourceMaps?: boolean; |
sentry-javascript/packages/nextjs/src/config/webpack.ts
Lines 338 to 345 in e5d1575
// `hidden-source-map` produces the same sourcemaps as `source-map`, but doesn't include the `sourceMappingURL` | |
// comment at the bottom. For folks who aren't publicly hosting their sourcemaps, this is helpful because then | |
// the browser won't look for them and throw errors into the console when it can't find them. Because this is a | |
// front-end-only problem, and because `sentry-cli` handles sourcemaps more reliably with the comment than | |
// without, the option to use `hidden-source-map` only applies to the client-side build. | |
newConfig.devtool = | |
isServer || userNextConfig.productionBrowserSourceMaps ? 'source-map' : 'hidden-source-map'; | |
} |
Solution Brainstorm
Add a hideSourceMaps
option to all meta frameworks that support bundleSizeOptimizations
and abide by it.
km-tr