feat: add hiddenSourceMaps option to prevent sourcemap exposure - #84152
feat: add hiddenSourceMaps option to prevent sourcemap exposure#84152omareltomy wants to merge 4 commits into
Conversation
- Add hiddenSourceMaps boolean option to Next.js config - When enabled with productionBrowserSourceMaps, generates 'hidden-source-map' instead of 'source-map' - Prevents # sourceMappingURL comments in generated JS bundles - Allows error tracking services to use source maps while hiding them from end users - Fixes S3/CDN 404 errors when source maps aren't uploaded publicly Closes #[84095]
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
DevToolsIgnorePlugin should be applied to both 'source-map' and 'hidden-source-map' since they both generate actual source map files that benefit from ignore list functionality for debugging.
|
@omareltomy Looking at Next.js's docs,
It seems clear that even the people who wrote the docs recognize that it's not often ideal to serve your sourcemaps unless that is something you explicitly want to do. However, there are plenty of users who want to generate sourcemaps for use cases such as error log de-obfuscation in logging and monitoring software. |
Closes #[84095]