-
Notifications
You must be signed in to change notification settings - Fork 131
/
app.config.ts
52 lines (49 loc) · 1.29 KB
/
app.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { sentryVitePlugin } from '@sentry/vite-plugin'
import { defineConfig } from '@tanstack/start/config'
import tsConfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
server: {
preset: 'netlify',
},
vite: {
plugins: [
tsConfigPaths(),
(() => {
const replacements = [
// replace `throw Error(p(418))` with `console.error(p(418))`
['throw Error(p(418))', 'console.error(p(418))'],
// replace `throw new Error('Hydration failed` with `console.error('Hydration failed')`
[
`throw new Error('Hydration failed`,
`console.error('Hydration failed`,
],
] as const
return {
name: 'tanner-test',
enforce: 'post',
transform(code, id) {
replacements.forEach(([search, replacement]) => {
if (code.includes(search)) {
code = code.replaceAll(search, replacement)
}
})
return code
},
}
})(),
],
},
routers: {
client: {
vite: {
plugins: [
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'tanstack',
project: 'tanstack-com',
}),
],
},
},
},
})