-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathvite.config.ts
More file actions
54 lines (49 loc) · 1.21 KB
/
vite.config.ts
File metadata and controls
54 lines (49 loc) · 1.21 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
53
54
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
export default defineConfig({
plugins: [
viteStaticCopy({
targets: [
{
src: 'node_modules/@mediapipe/tasks-vision/wasm/*',
dest: 'wasm',
},
],
}),
],
// Development server configuration
server: {
port: 2501,
open: true,
// Required for camera access - HTTPS in development
// Note: For production, ensure proper HTTPS is configured
host: true,
},
// Asset handling
assetsInclude: ['**/*.glsl', '**/*.glb'],
// Build configuration
build: {
target: 'ES2020',
outDir: 'dist',
sourcemap: true,
minify: 'esbuild', // Use esbuild (built-in) instead of terser
rollupOptions: {
output: {
// Chunk splitting for better caching
manualChunks: {
three: ['three'],
mediapipe: ['@mediapipe/tasks-vision'],
},
},
},
chunkSizeWarningLimit: 1000,
},
// Optimize dependencies
optimizeDeps: {
include: ['three', '@mediapipe/tasks-vision'],
},
// Define environment variables
define: {
__DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
},
});