Skip to content

Commit 781c3a9

Browse files
authored
doc(sveltekit): Adjust README Vite setup section (#7792)
1 parent 87b33e2 commit 781c3a9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/sveltekit/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,20 @@ The Sentry SvelteKit SDK mostly relies on [SvelteKit Hooks](https://kit.svelte.d
150150

151151
### 5. Vite Setup
152152

153-
3. Add our `withSentryViteConfig` wrapper around your Vite config so that the Sentry SDK can add its plugins to your Vite config `vite.config.(js|ts)`:
153+
1. Add our `sentrySvelteKitPlugin` to your `vite.config.(js|ts)` file so that the Sentry SDK can apply build-time features.
154+
Make sure that it is added before the `sveltekit` plugin:
155+
154156
```javascript
155157
import { sveltekit } from '@sveltejs/kit/vite';
156-
import { withSentryViteConfig } from '@sentry/sveltekit';
158+
import { sentrySvelteKitPlugin } from '@sentry/sveltekit';
157159

158-
export default withSentryViteConfig({
159-
plugins: [sveltekit()],
160-
// ...
161-
});
160+
export default {
161+
plugins: [sentrySvelteKitPlugin(), sveltekit()],
162+
// ... rest of your Vite config
163+
};
162164
```
163165

164-
In the near future this wrapper will add and configure our [Sentry Vite Plugin](https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/vite-plugin) to automatically upload source maps to Sentry.
165-
Furthermore, if you prefer to intialize the Sentry SDK in dedicated files, instead of the hook files, you can move the `Sentry.init` code to `sentry.(client|server).config.(js|ts)` files and `withSentryViteConfig` will take care of adding them to your server and client bundles.
166+
In the near future this plugin will add and configure our [Sentry Vite Plugin](https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/vite-plugin) to automatically upload source maps to Sentry.
166167

167168
## Known Limitations
168169

0 commit comments

Comments
 (0)