feat(core): Add hook to customize source map file resolution#732
Merged
andreiborza merged 3 commits intogetsentry:mainfrom May 13, 2025
Merged
Conversation
BoomchainLabs
approved these changes
May 2, 2025
andreiborza
reviewed
May 8, 2025
Member
andreiborza
left a comment
There was a problem hiding this comment.
Hi, thanks so much for contributing this and the nice test suite!
lforst
reviewed
May 8, 2025
lforst
reviewed
May 8, 2025
lforst
reviewed
May 8, 2025
1. Added better debug logging around the `resolveSourceMap` hook invocation 2. Expanded the `resolveSourceMap` doc comment to include more detail and an example use case 3. Added `resolveSourceMap` documentation to `generate-documentation-table.ts` 4. Removed the feature-specific playground test previously added
andreiborza
approved these changes
May 13, 2025
Member
andreiborza
left a comment
There was a problem hiding this comment.
Looking good, thanks for contributing this!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 24, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 3.4.0 | 3.5.0 | ## [v3.5.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#350) - feat(core): Add hook to customize source map file resolution ([#732](getsentry/sentry-javascript-bundler-plugins#732)) - fix(core): Avoid console output and telemetry init when plugins are disabled ([#741](getsentry/sentry-javascript-bundler-plugins#741)) Work in this release was contributed by [@thecodewarrior](https://github.com/thecodewarrior). Thank you for your contribution!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 24, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 3.4.0 | 3.5.0 | ## [v3.5.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#350) - feat(core): Add hook to customize source map file resolution ([#732](getsentry/sentry-javascript-bundler-plugins#732)) - fix(core): Avoid console output and telemetry init when plugins are disabled ([#741](getsentry/sentry-javascript-bundler-plugins#741)) Work in this release was contributed by [@thecodewarrior](https://github.com/thecodewarrior). Thank you for your contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wasn't able to implement full integration tests for the sourcemap changes, but there's a smoke test in the playground and I added full unit tests for the function that performs the file resolution.
One of the only changes I made to the existing behavior is using
url.fileUrlToPath()when thesourceMappingURLis afile://url. I added some additional debug logging to that method as well. Now when it fails to locate a sourcemap it prints all the locations it tried, and when it succeeds it prints out the source map it chose.Fixes #731