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
We want to bump the vite-plugin version to latest in SvelteKit, and also stop passing plugin options through directly so we can in the future update this easier without a breaking change.
…ns API (#10813)
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:
- We now use DebugId-based sourcemap upload 🎉
- Due to architecture changes in `@sentry/vite-plugin`, our
`sentrySvelteKit` 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.
- We still have to modify source maps a bit before uploading them and
all of this should still happen as late as possible. So we still create
a customized version of the uploading plugin and return that instead of
the original one.
- Also added direct usage of `MagicString` to inject global values
needed during runtime. Previously, I just handed my modified code to the
original plugin's `transform` hook which might have even messed up
source maps.
- The new API is a subset of all Sentry Vite plugin options.
- I'm happy to add more options before merging this PR. I just don't
think we need all of them right from the start. As an alternative, we
could allow users to pass in arbitrary options and we type them as
`unknown` or something along these lines 🤔
Example usage (showing all available options; all are optional)
```js
sentrySvelteKit({
autoUploadSourceMaps: true,
sourceMapsUploadOptions: {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
release: {
name: '1.0.1',
inject: true
},
sourcemaps: {
assets: ['./build/*/**/*'],
ignore: ['**/build/client/**/*'],
filesToDeleteAfterUpload: ['./build/**/*.map']
}
},
autoInstrument: true,
debug: true
}),
```
closes#9835closes#8283
---------
Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
We want to bump the vite-plugin version to latest in SvelteKit, and also stop passing plugin options through directly so we can in the future update this easier without a breaking change.
see #8283
The text was updated successfully, but these errors were encountered: