-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (44 loc) 路 1.17 KB
/
Copy pathvite.config.ts
File metadata and controls
45 lines (44 loc) 路 1.17 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
import { defineConfig, ConfigEnv } from "vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig(({ mode }: ConfigEnv) => ({
server: {
host: "0.0.0.0",
port: 5000,
},
build: {
// Ensure fresh builds - no cache
outDir: 'dist',
emptyOutDir: true,
chunkSizeWarningLimit: 1000,
// Add cache busting with content hashes.
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('three') || id.includes('@react-three')) {
return 'three';
}
if (id.includes('framer-motion')) {
return 'framer-motion';
}
if (id.includes('radix-ui') || id.includes('@radix-ui')) {
return 'radix-ui';
}
return 'vendor';
}
},
entryFileNames: '[name].[hash].js',
chunkFileNames: '[name].[hash].js',
assetFileNames: '[name].[hash][extname]',
},
},
},
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
}));