-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
28 lines (26 loc) · 613 Bytes
/
Copy pathvite.config.ts
File metadata and controls
28 lines (26 loc) · 613 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
const API_PORT = Number(process.env.API_PORT) || 3030;
export default defineConfig({
plugins: [react()],
server: {
port: Number(process.env.VITE_PORT) || 6060,
strictPort: false,
proxy: {
'/api': {
target: `http://localhost:${API_PORT}`,
changeOrigin: true,
},
},
},
preview: {
port: Number(process.env.VITE_PORT) || 6060,
strictPort: false,
proxy: {
'/api': {
target: `http://localhost:${API_PORT}`,
changeOrigin: true,
},
},
},
});