-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
49 lines (46 loc) · 1.41 KB
/
Copy pathvite.config.js
File metadata and controls
49 lines (46 loc) · 1.41 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
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import mkcert from 'vite-plugin-mkcert';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
const root = dirname(fileURLToPath(import.meta.url));
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, root, '');
return {
plugins: [react(), svgr(), mkcert()],
server: {
https: true,
proxy: {
'/api': {
target: env.VITE_SERVER_URL_API,
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/storage-proxy': {
target: 'https://firebasestorage.googleapis.com',
changeOrigin: true,
secure: true,
rewrite: (path) => path.replace(/^\/storage-proxy/, ''),
},
'/pstatic-proxy': {
target: 'https://naverbooking-phinf.pstatic.net',
changeOrigin: true,
secure: true,
rewrite: (path) => path.replace(/^\/pstatic-proxy/, ''),
},
'/jigubyeol-proxy': {
target: 'https://xn--2e0b040a4xj.com',
changeOrigin: true,
secure: true,
rewrite: (path) => path.replace(/^\/jigubyeol-proxy/, ''),
},
},
cors: {
origin: 'https://localhost:5173',
credentials: true,
},
},
};
});