-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
39 lines (36 loc) · 1007 Bytes
/
Copy pathvite.config.ts
File metadata and controls
39 lines (36 loc) · 1007 Bytes
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import fs from 'fs'
// Read version from package.json
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'))
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: './',
optimizeDeps: {
include: ['react-is', 'recharts', '@react-three/fiber', '@react-three/drei', 'three']
},
define: {
__APP_VERSION__: JSON.stringify(packageJson.version)
},
build: {
outDir: 'web-dist'
},
server: {
// Development server configuration
port: 5173,
strictPort: false,
open: false,
proxy: {
'/api': {
target: 'https://backend.minebench.cloud',
changeOrigin: true,
// Local dev runs through Node's TLS stack, which may not trust the
// backend certificate chain even when browsers do.
secure: false,
rewrite: (path) => path.replace(/^\/api/, '/api')
}
}
}
})