Repository navigation
Expand file tree
/
Copy pathvite.config.js
More file actions
52 lines (48 loc) · 1.66 KB
/
Copy pathvite.config.js
File metadata and controls
52 lines (48 loc) · 1.66 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
import { defineConfig } from 'vite'
import { resolve } from 'path'
export default defineConfig({
// GitHub Pages serves from /M-indicator-2.0/ subdirectory
base: '/M-indicator-2.0/',
// Build configuration
build: {
outDir: 'dist',
emptyOutDir: true,
// Warn if chunk > 700kb
chunkSizeWarningLimit: 700,
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
upcoming: resolve(__dirname, 'upcoming.html'),
news: resolve(__dirname, 'news.html'),
resumedb: resolve(__dirname, 'resumedb.html'),
ad: resolve(__dirname, 'ad.html'),
contact: resolve(__dirname, 'contact.html'),
terms: resolve(__dirname, 'terms.html'),
notfound: resolve(__dirname, '404.html'),
},
output: {
// Clean hashed asset names for cache-busting
assetFileNames: 'assets/[name]-[hash][extname]',
chunkFileNames: 'assets/[name]-[hash].js',
entryFileNames: 'assets/[name]-[hash].js',
}
},
// Minify for production
minify: 'esbuild',
// Generate source maps for debugging (optional, remove for leaner build)
sourcemap: false,
// CSS code splitting
cssCodeSplit: true,
},
// Asset handling
assetsInclude: ['**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.svg', '**/*.webp', '**/*.mp4'],
// Dev server config
server: {
port: 5173,
open: false,
},
// Preview server (simulates production)
preview: {
port: 4173,
},
})