-
Notifications
You must be signed in to change notification settings - Fork 41
Add hook to customize source map file resolution #731
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
Comments
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. |
Just for me to understand: Why can't you use the |
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 |
@thecodewarrior thanks for the PR, we'll have a look! |
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.Here's an example of how our solution might look:
The text was updated successfully, but these errors were encountered: