forked from TanStack/tanstack.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (52 loc) · 1.36 KB
/
Copy pathvite.config.ts
File metadata and controls
55 lines (52 loc) · 1.36 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
46
47
48
49
50
51
52
53
54
55
import { sentryVitePlugin } from '@sentry/vite-plugin'
import { defineConfig } from 'vite'
import contentCollections from '@content-collections/vite'
import tsConfigPaths from 'vite-tsconfig-paths'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import tailwindcss from '@tailwindcss/vite'
import { analyzer } from 'vite-bundle-analyzer'
import viteReact from '@vitejs/plugin-react'
import netlify from '@netlify/vite-plugin-tanstack-start'
export default defineConfig({
server: {
port: 3000,
},
ssr: {
external: ['postgres'],
noExternal: ['drizzle-orm'],
},
optimizeDeps: {
exclude: ['postgres'],
},
build: {
rollupOptions: {
external: (id) => {
// Externalize postgres from client bundle
return id.includes('postgres')
},
},
},
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart(),
// Only enable Netlify plugin during build or when NETLIFY env is set
...(process.env.NETLIFY || process.env.NODE_ENV === 'production'
? [netlify()]
: []),
viteReact(),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'tanstack',
project: 'tanstack-com',
}),
contentCollections(),
tailwindcss(),
analyzer({
enabled: false,
openAnalyzer: true,
defaultSizes: 'gzip',
}),
],
})