Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hideSourceMaps in all meta frameworks #13613

Closed
andreiborza opened this issue Sep 9, 2024 · 1 comment
Closed

Implement hideSourceMaps in all meta frameworks #13613

andreiborza opened this issue Sep 9, 2024 · 1 comment

Comments

@andreiborza
Copy link
Member

andreiborza commented Sep 9, 2024

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 😅 ).

/**
* Use `hidden-source-map` for webpack `devtool` option, which strips the `sourceMappingURL` from the bottom of built
* JS files.
*/
hideSourceMaps?: boolean;

// `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.

@s1gr1d
Copy link
Member

s1gr1d commented Dec 10, 2024

Closing this in favor of this: #13993

If no explicit user-setting is provided, we will enable source maps generation by setting hidden.

@s1gr1d s1gr1d closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants