-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (44 loc) · 1.29 KB
/
vite.config.ts
File metadata and controls
45 lines (44 loc) · 1.29 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 tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import {defineConfig, loadEnv} from 'vite';
export default defineConfig(({mode}) => {
const env = loadEnv(mode, '.', '');
return {
base: '/',
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
server: {
hmr: process.env.DISABLE_HMR !== 'true',
},
build: {
chunkSizeWarningLimit: 800,
rollupOptions: {
output: {
manualChunks(id) {
if (!id.includes('node_modules')) return undefined;
if (id.includes('react-router-dom') || id.includes('react-dom') || id.includes('/react/')) {
return 'react-vendor';
}
if (id.includes('/three/')) {
return 'three-core';
}
if (id.includes('@react-three/fiber')) {
return 'world-r3f';
}
if (id.includes('@react-three/drei') || id.includes('three-stdlib')) {
return 'world-drei';
}
if (id.includes('motion')) return 'motion';
if (id.includes('lucide-react')) return 'icons';
return undefined;
},
},
},
},
};
});