-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
52 lines (50 loc) · 1.22 KB
/
vite.config.ts
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// Handle base URL for both GitHub Pages and self-hosting
const base = process.env.GITHUB_PAGES === 'true' ? '/reconciliation/' : '/';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
base, // Use the conditional base URL
build: {
outDir: 'dist',
assetsDir: 'assets',
sourcemap: false,
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
},
rollupOptions: {
output: {
manualChunks: {
'vendor': [
'react',
'react-dom',
'lodash',
'xlsx',
'papaparse'
],
'ui': [
'lucide-react',
'@/components/ui/card'
]
},
entryFileNames: 'assets/[name]-[hash].js',
chunkFileNames: 'assets/[name]-[hash].js',
assetFileNames: 'assets/[name]-[hash].[ext]'
}
},
chunkSizeWarningLimit: 600
},
optimizeDeps: {
include: ['react', 'react-dom', 'lodash', 'xlsx', 'papaparse', 'lucide-react']
}
});