[feature] Ability to delete source maps after uploading them
As raised in https://github.com/getsentry/sentry-javascript/issues/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.