Skip to content
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

feat(core): Add hook to customize source map file resolution - #732

Merged
andreiborza merged 3 commits into
getsentry:mainfrom
thecodewarrior:feature/resolve-source-map-hook
May 13, 2025
Merged

andreiborza merged 3 commits into
getsentry:mainfrom
thecodewarrior:feature/resolve-source-map-hook

Conversation

@thecodewarrior

Copy link
Copy Markdown
Contributor

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 the sourceMappingURL is a file:// 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

@chargome
chargome requested review from Lms24 and lforst May 2, 2025 08:09

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks so much for contributing this and the nice test suite!

Comment thread packages/playground/package.json Resolved
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 andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks for contributing this!

@andreiborza
andreiborza merged commit b33725e into getsentry:main May 13, 2025
@thecodewarrior
thecodewarrior deleted the feature/resolve-source-map-hook branch May 13, 2025 17:59
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!
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add hook to customize source map file resolution

4 participants