-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
37 lines (36 loc) · 1.13 KB
/
vite.config.ts
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
import react from '@vitejs/plugin-react-swc'
import path from 'path'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: './',
resolve: {
alias: {
'@local/src': path.resolve(__dirname, './src'),
'@local/ui': path.resolve(__dirname, './src/ui'),
'@local/asset': path.resolve(__dirname, './src/asset'),
'@local/const': path.resolve(__dirname, './src/const'),
'@local/network': path.resolve(__dirname, './src/network'),
'@local/page': path.resolve(__dirname, './src/ui/page'),
'@local/util': path.resolve(__dirname, './src/util'),
},
},
server: {
proxy: {
'/api/': {
target: 'https://api.mudev.cc',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
secure: true,
},
// As refresh token cookie is restrict path to /authn/, we need to proxy /authn/ to api.mudev.cc
'/authn/': {
target: 'https://api.mudev.cc/authn',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/authn/, ''),
secure: true,
},
},
},
})