-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
30 lines (29 loc) · 1.13 KB
/
Copy pathvite.config.js
File metadata and controls
30 lines (29 loc) · 1.13 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
assetsInclude: ['**/*.glb'],
build: {
rollupOptions: {
output: {
manualChunks: {
// Split React and related libraries into a separate chunk
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
// Split Three.js and related 3D libraries into a separate chunk
'three-vendor': ['@react-three/fiber', '@react-three/drei', '@react-spring/three'],
// Split other heavy dependencies
'vendor': ['@emailjs/browser', 'posthog-js', '@vercel/speed-insights'],
},
},
// Suppress eval warnings from third-party libraries we don't control
onwarn(warning, warn) {
// Suppress eval warning from three-stdlib/lottie.js (we don't use lottie directly)
if (warning.code === 'EVAL' && warning.id?.includes('three-stdlib')) return;
warn(warning);
},
},
// Increase chunk size warning limit since we're dealing with 3D models
chunkSizeWarningLimit: 1000,
},
})