-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
40 lines (38 loc) · 1.43 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
38
39
40
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
import path from 'path'
export default defineConfig({
server: {
host: '0.0.0.0',
proxy: {
'/api': {
// 本地
// target: 'http://localhost:3000/',
// 线上
target: 'https://service-eq8476me-1322095897.gz.apigw.tencentcs.com/',
// target: 'https://mu-api.yuk0.com/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
pages: path.resolve(__dirname, 'src/pages'),
components: path.resolve(__dirname, 'src/components'),
modules: path.resolve(__dirname, 'src/modules'),
types: path.resolve(__dirname, 'src/types'),
utils: path.resolve(__dirname, 'src/utils'),
configs: path.resolve(__dirname, 'src/configs'),
routers: path.resolve(__dirname, 'src/routers'),
assets: path.resolve(__dirname, 'src/assets'),
styles: path.resolve(__dirname, 'src/styles'),
layouts: path.resolve(__dirname, 'src/layouts'),
hooks: path.resolve(__dirname, 'src/hooks'),
api: path.resolve(__dirname, 'src/api'),
},
},
plugins: [react(), svgr()],
})