feat(sveltekit): Update @sentry/vite-plugin
to 2.x and adjust options API
#10813
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.
This PR updates
@sentry/vite-plugin
used in the SvelteKit SDK from version 0.6.x to the latest 2.x version. In line with this change, we now also decoupled the public API of the vite plugin from the SvelteKit SDK public API, meaning we can bump to a higher plugin major version while we stay in the same SDK major version.Concrete changes:
@sentry/vite-plugin
, oursentrySvelteKit
plugin factory function returns 6 (5x sourcemap, 1x auto instrumentation) plugins instead of previously two. This is because the Vite plugin now consists of several individual plugins.MagicString
to inject global values needed during runtime. Previously, I just handed my modified code to the original plugin'stransform
hook which might have even messed up source maps.unknown
or something along these lines 🤔Example usage (showing all available options; all are optional)
closes #9835
closes #8283