-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
44 lines (43 loc) · 1.08 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
41
42
43
44
/*
* @Author: Jason
* @Date: 2021-10-11 11:37:24
* @LastEditors: Jason [email protected]
* @LastEditTime: 2023-01-12
* @FilePath: /vite.config.ts
* @description: description
*/
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import ElementPlus from 'unplugin-element-plus/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import { defineConfig, loadEnv } from 'vite'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
base: '/swagger2model/',
plugins: [
vue(),
Components({
resolvers: [ElementPlusResolver()]
}),
ElementPlus()
],
resolve: {
alias: {
'@': resolve('src')
}
},
server: {
proxy: {
'/api': {
// TODO: 自行修改为内网swagger json地址。目前无法动态配置,如有办法请pr
target: 'http://',
changeOrigin: true,
rewrite: path => ''
}
}
}
}
})