-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
50 lines (49 loc) · 1.38 KB
/
Copy pathvite.config.ts
File metadata and controls
50 lines (49 loc) · 1.38 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
base: '/superdskp/',
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
target: 'esnext',
minify: 'terser',
rollupOptions: {
output: {
manualChunks: {
'vendor': ['react', 'react-dom'],
'ui': ['class-variance-authority', 'clsx', 'tailwind-merge'],
'icons': ['lucide-react'],
},
// Optimize chunk file naming for better caching
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: (assetInfo) => {
const info = assetInfo.name || ''
if (/\.(css)$/i.test(info)) {
return 'assets/css/[name]-[hash][extname]'
}
return 'assets/[name]-[hash][extname]'
},
},
},
// Enable source maps for production debugging (optional)
sourcemap: false,
// Reduce chunk size warnings threshold
chunkSizeWarningLimit: 500,
},
// Optimize dev server
server: {
open: true,
cors: true,
},
// Optimize dependencies pre-bundling
optimizeDeps: {
include: ['react', 'react-dom', 'lucide-react', 'class-variance-authority', 'clsx', 'tailwind-merge'],
},
})