Skip to content

Commit 32a77a0

Browse files
committed
chore/ui: try fix build bug
Signed-off-by: SeeuSim <[email protected]>
1 parent 11abbd8 commit 32a77a0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

frontend/vite.config.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,39 @@ export default defineConfig(({ mode }) => {
2323
proxy: {
2424
'/user-service': {
2525
target: env.VITE_USER_SERVICE,
26-
rewrite: (path: string) =>
27-
String(path).replace && String(path).replace(/^\/user-service/, ''),
26+
rewrite: (path: string) => path?.replace && path.replace(/^\/user-service/, ''),
2827
changeOrigin: true,
2928
cookiePathRewrite: {
3029
'*': '/',
3130
},
3231
},
3332
'/question-service': {
3433
target: env.VITE_QUESTION_SERVICE,
35-
rewrite: (path: string) =>
36-
String(path).replace && String(path).replace(/^\/question-service/, ''),
34+
rewrite: (path: string) => path?.replace && path.replace(/^\/question-service/, ''),
3735
changeOrigin: true,
3836
cookiePathRewrite: {
3937
'*': '/',
4038
},
4139
},
4240
'/collaboration-service': {
4341
target: env.VITE_COLLAB_SERVICE,
44-
rewrite: (path: string) =>
45-
String(path).replace && String(path).replace(/^\/collaboration-service/, ''),
42+
rewrite: (path: string) => path?.replace && path.replace(/^\/collaboration-service/, ''),
4643
changeOrigin: true,
4744
cookiePathRewrite: {
4845
'*': '/',
4946
},
5047
},
5148
'/matching-service': {
5249
target: env.VITE_MATCHING_SERVICE,
53-
rewrite: (path: string) =>
54-
String(path).replace && String(path).replace(/^\/matching-service/, ''),
50+
rewrite: (path: string) => path?.replace && path.replace(/^\/matching-service/, ''),
5551
changeOrigin: true,
5652
cookiePathRewrite: {
5753
'*': '/',
5854
},
5955
},
6056
'/collab-ws': {
6157
target: `${env.VITE_COLLAB_SERVICE.replace('http', 'ws')}`,
62-
rewrite: (path: string) =>
63-
String(path).replace && String(path).replace(/\/collab-ws/, ''),
58+
rewrite: (path: string) => path?.replace && path.replace(/\/collab-ws/, ''),
6459
ws: true,
6560
},
6661
'/matching-socket/': {

0 commit comments

Comments
 (0)