-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (59 loc) · 1.65 KB
/
Copy pathvite.config.ts
File metadata and controls
60 lines (59 loc) · 1.65 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
export default defineConfig({
plugins: [react()],
root: resolve(__dirname, 'src/renderer'),
publicDir: resolve(__dirname, 'src/renderer/public'),
resolve: {
alias: {
'@shared': resolve(__dirname, 'src/shared'),
'@renderer': resolve(__dirname, 'src/renderer/src'),
'@': resolve(__dirname, 'src/renderer/src')
}
},
build: {
outDir: resolve(__dirname, 'dist'),
emptyOutDir: true,
sourcemap: true,
target: 'es2020',
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
ui: ['@radix-ui/react-select', '@radix-ui/react-checkbox', '@radix-ui/react-label', '@radix-ui/react-slider', '@radix-ui/react-slot', '@radix-ui/react-switch', '@radix-ui/react-tabs'],
motion: ['framer-motion'],
charts: ['recharts'],
forms: ['react-hook-form', '@hookform/resolvers', 'zod'],
editor: ['@tiptap/react', '@tiptap/starter-kit', '@tiptap/extension-character-count', '@tiptap/extension-placeholder'],
utils: ['date-fns', 'clsx', 'tailwind-merge', 'fuse.js', 'use-debounce']
}
}
},
},
server: {
port: 5173,
strictPort: true,
},
preview: {
port: 4173,
strictPort: true,
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version || '1.0.0'),
},
optimizeDeps: {
include: [
'react',
'react-dom',
'react-router-dom',
'zustand',
'zod',
'date-fns',
'framer-motion',
'lucide-react',
'recharts',
'fuse.js'
]
}
})