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

[feature] Ability to delete source maps after uploading them #1318

Closed
lobsterkatie opened this issue Aug 31, 2022 · 1 comment
Closed

[feature] Ability to delete source maps after uploading them #1318

lobsterkatie opened this issue Aug 31, 2022 · 1 comment

Comments

@lobsterkatie
Copy link
Member

As raised in getsentry/sentry-javascript#4489, some users are concerned about exposing their original source code to the public via things like browser dev tools automatically applying published sourcemaps.

We've taken the first step towards solving that, by switching the default in the nextjs SDK to use the hidden-source-map value for Webpack's devtool option, which prevents built files from including a sourceMappingURL comment at the bottom, thereby removing the signal to browser dev tools that source maps even exist. For some folks, this will be enough. Others may want to prevent the source maps from being published at all, hidden or not, and the only surefire way to do that is to delete them after they're uploaded to Sentry. Since sentry-cli is already finding them in the filesystem, and is the first to know when the upload is finished, it's logical that it also be the one to do the deletion. Thus, this feature request, which would presumably be a flag passed to the upload-sourcemaps command.

lobsterkatie added a commit to getsentry/sentry-netlify-build-plugin that referenced this issue Mar 9, 2023
This adds a new option, `deleteSourceMaps` (or `SENTRY_DELETE_SOURCEMAPS` as an env variable), which will delete sourcemaps after uploading them.

Really this should be done at the `sentry-cli` level (see getsentry/sentry-cli#1318), but in the meantime, we can do it manually.

Fixes #40
@kamilogorek
Copy link
Contributor

https://github.com/getsentry/sentry-javascript-bundler-plugins/ v2 has been released, which has deleteFilesAfterUpload option, which should do the work for this use-case.

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

2 participants