-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
63 lines (56 loc) · 1.47 KB
/
vite.config.js
File metadata and controls
63 lines (56 loc) · 1.47 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
55
56
57
58
59
60
61
62
63
// vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
proxy: {
// 1) 콜백 경로는 index.html 반환 → React Router로 처리
'/auth/kakao/callback': {
// target은 dev 서버 자신(localhost:5173)이지만,
// bypass 콜백에서 index.html 경로를 리턴
target: 'http://localhost:5173',
changeOrigin: true,
secure: false,
bypass: () => '/index.html',
},
// 2) 나머지 /auth/* 요청은 백엔드로
'/auth': {
target: 'http://13.125.152.246:5000',
changeOrigin: true,
secure: false,
},
'/user': {
target: 'http://13.125.152.246:5000',
changeOrigin: true,
secure: false,
},
'/score': {
target: 'http://13.125.152.246:5000',
changeOrigin: true,
secure: false,
},
'/transform': {
target: 'http://13.125.152.246:5000',
changeOrigin: true,
secure: false,
},
'/mypage': {
target: 'http://13.125.152.246:5000',
changeOrigin: true,
secure: false,
},
// 필요시 /result 등도 추가
}
},
build: {
rollupOptions: {
output: {
entryFileNames: '[name].[hash].js',
chunkFileNames: '[name].[hash].js',
assetFileNames: '[name].[hash][extname]',
}
}
},
base: './',
})