-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (40 loc) · 1.17 KB
/
vite.config.ts
File metadata and controls
41 lines (40 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3000,
proxy: {
// Proxy font resolver requests to bypass CORS
'/font-proxy': {
target: 'https://cdn.jsdelivr.net',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/font-proxy/, ''),
},
},
},
publicDir: 'public',
assetsInclude: ['**/*.gltf', '**/*.glb', '**/*.bin', '**/*.obj', '**/*.mtl'],
optimizeDeps: {
exclude: ['three/examples/jsm/loaders/GLTFLoader', 'three/examples/jsm/loaders/OBJLoader'],
},
build: {
rollupOptions: {
output: {
manualChunks: {
// Three.js core
'three-core': ['three'],
// React Three Fiber and Drei
'react-three': ['@react-three/fiber', '@react-three/drei'],
// React vendor
'react-vendor': ['react', 'react-dom'],
// Other vendor libraries
'vendor': ['troika-three-text'],
},
},
},
chunkSizeWarningLimit: 1000,
assetsInlineLimit: 0, // Don't inline any assets, serve them as separate files
},
})