Skip to content

Commit 7bdfe2f

Browse files
authored
docs(js): Add diffs to react router build config (#13098)
1 parent 34ac1d0 commit 7bdfe2f

File tree

1 file changed

+5
-5
lines changed
  • docs/platforms/javascript/guides/react-router

1 file changed

+5
-5
lines changed

docs/platforms/javascript/guides/react-router/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Update `vite.config.ts` to include the `sentryReactRouter` plugin. Also add your
209209

210210
<OrgAuthTokenNote />
211211

212-
```typescript {filename: vite.config.ts}
212+
```typescript {filename: vite.config.ts} {diff}
213213
import { reactRouter } from '@react-router/dev/vite';
214214
import { sentryReactRouter, type SentryReactRouterBuildOptions } from '@sentry/react-router';
215215
import { defineConfig } from 'vite';
@@ -225,15 +225,15 @@ const sentryConfig: SentryReactRouterBuildOptions = {
225225

226226
export default defineConfig(config => {
227227
return {
228-
plugins: [reactRouter(), sentryReactRouter(sentryConfig, config)],
229-
sentryConfig,
228+
+ plugins: [reactRouter(),sentryReactRouter(sentryConfig, config)],
229+
+ sentryConfig, // Also pass the config here!
230230
};
231231
});
232232
```
233233

234234
Include the `sentryOnBuildEnd` hook in `react-router.config.ts`:
235235

236-
```typescript {filename: react-router.config.ts} {9}
236+
```typescript {filename: react-router.config.ts} {diff}
237237
import type { Config } from '@react-router/dev/config';
238238
import { sentryOnBuildEnd } from '@sentry/react-router';
239239

@@ -242,7 +242,7 @@ export default {
242242
buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {
243243
// ...
244244
// Call this at the end of the hook
245-
await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest });
245+
+ await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest });
246246
},
247247
} satisfies Config;
248248
```

0 commit comments

Comments
 (0)