-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathvite.config.ts
More file actions
100 lines (97 loc) · 2.82 KB
/
vite.config.ts
File metadata and controls
100 lines (97 loc) · 2.82 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import path from 'node:path'
import { defineConfig } from 'vite'
import { devtools } from '@tanstack/devtools-vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
const config = defineConfig({
plugins: [
devtools(),
tailwindcss(),
...(process.env.VITEST ? [] : [tanstackStart()]),
viteReact(),
],
resolve: {
tsconfigPaths: true,
dedupe: ['react', 'react-dom', '@radix-ui/react-dialog'],
alias: {
url: path.resolve(__dirname, 'src/shims/url.ts'),
},
},
optimizeDeps: {
include: [
'react',
'react-dom',
'react/jsx-runtime',
'react/jsx-dev-runtime',
'react-dom/client',
'react-dom/server',
'styled-components',
'dayjs',
'dayjs/plugin/advancedFormat.js',
'dayjs/plugin/duration.js',
'dayjs/plugin/localizedFormat.js',
'dayjs/plugin/relativeTime.js',
'dayjs/plugin/timezone.js',
'dayjs/plugin/updateLocale.js',
'dayjs/plugin/utc.js',
'lodash-es',
'react-window',
'react-virtualized-auto-sizer',
'react-sortablejs/dist/index.js',
'react-syntax-highlighter',
'react-syntax-highlighter/dist/cjs/languages/hljs/sql.js',
'react-syntax-highlighter/dist/cjs/languages/hljs/bash.js',
'react-syntax-highlighter/dist/cjs/languages/hljs/json.js',
'react-syntax-highlighter/dist/cjs/languages/hljs/typescript.js',
'react-syntax-highlighter/dist/cjs/languages/hljs/plaintext.js',
'@radix-ui/react-tooltip',
'@radix-ui/react-accordion',
'@radix-ui/react-toast',
'@radix-ui/react-avatar',
'@radix-ui/react-popover',
'@radix-ui/react-separator',
'@radix-ui/react-checkbox',
'@radix-ui/react-context-menu',
'@radix-ui/react-dialog',
'@radix-ui/react-dropdown-menu',
'@radix-ui/react-tabs',
'@radix-ui/react-hover-card',
'@radix-ui/react-radio-group',
'@radix-ui/react-switch',
'@h6s/calendar',
'@tanstack/router-core',
'@tanstack/router-core/ssr/client',
'@tanstack/router-core/ssr/server',
'@tanstack/history',
'h3-v2',
'tiny-invariant',
'seroval',
],
},
build: {
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{
name: 'icons',
test: /click-ui.*Icon|click-ui.*icon/,
priority: 30,
},
{
name: 'vendor-ui',
test: /node_modules\/@clickhouse\/click-ui/,
priority: 20,
},
],
},
},
},
},
ssr: {
external: ['@playwright/test', 'playwright-core', 'playwright', '@axe-core/playwright'],
noExternal: ['@clickhouse/click-ui'],
},
})
export default config