-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (39 loc) · 1.06 KB
/
vite.config.ts
File metadata and controls
45 lines (39 loc) · 1.06 KB
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
import { reactRouter } from '@react-router/dev/vite'
import { sentryReactRouter } from '@sentry/react-router'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'vite'
import devtoolsJson from 'vite-plugin-devtools-json'
export default defineConfig(async (configEnv) => {
const { mode } = configEnv
const isTest = mode === 'test'
const publishRelease = !isTest && process.env.SENTRY_PUBLISH_RELEASE === '1'
return {
build: {
sourcemap: 'hidden' as const,
},
resolve: {
tsconfigPaths: true,
},
plugins: [
tailwindcss(),
!isTest && reactRouter(),
!isTest && mode !== 'production' && devtoolsJson(),
...(publishRelease
? await sentryReactRouter(
{
org: 'techtalkjp',
project: 'upflow',
authToken: process.env.SENTRY_AUTH_TOKEN,
},
configEnv,
)
: []),
],
server: {
allowedHosts: ['.ngrok-free.app'],
},
optimizeDeps: {
exclude: ['@sentry/react-router'],
},
}
})