You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Add hook to customize source map file resolution #731
The sentry plugin currently uses heuristics to locate sourcemap files for a given bundle file, but in some build configurations this is insufficient. Specifically if the sourcemaps are being written to a separate directory. It would be good to have a hook, similar to sourcemaps.rewriteSources, that would allow you to manually resolve the .map files.
In our specific webpack build we're writing our sourcemaps into a separate directory so they can be bundled up and hosted separately. To do this we configure the SourceMapDevToolPlugin with a custom filename pattern and //# sourceMappingURL line. However, the sentry plugin doesn't know about or understand any of these configs, so it's unable to locate the source map files.
I didn't test that option, but as far as I understand it, using that might allow the sourcemaps to be uploaded, but they won't correctly have the debug IDs added and won't be associated with the correct JS files
Activity
lforst commentedon Apr 29, 2025
Thanks for the suggestion. This seems like an extremely reasonable feature. Feel free to open a PR! Otherwise we'll get to it sometime in the future.
Lms24 commentedon Apr 29, 2025
Just for me to understand: Why can't you use the
sourcemaps.assetsoption to set the path to the source maps?thecodewarrior commentedon Apr 30, 2025
I didn't test that option, but as far as I understand it, using that might allow the sourcemaps to be uploaded, but they won't correctly have the debug IDs added and won't be associated with the correct JS files
feat(core): Add hook to customize source map file resolution
chargome commentedon May 2, 2025
@thecodewarrior thanks for the PR, we'll have a look!
feat(core): Add hook to customize source map file resolution (#732)