-
Notifications
You must be signed in to change notification settings - Fork 68
/
vite.config.ts
47 lines (46 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
45
46
47
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import path from 'path'
import Unocss from 'unocss/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
uni(),
// https://github.com/antfu/unocss
Unocss()
],
server: {
// port: 8080,
host: '0.0.0.0',
proxy: {
'/api/': {
target:
'https://service-rbji0bev-1256505457.cd.apigw.tencentcs.com/release',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
},
'/api-prod/': {
target: 'http://localhost:3001',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api-prod/, '')
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components')
}
},
css: {
// 配置`scss`和`less`全局变量
preprocessorOptions: {
scss: {
additionalData: '@import "@/styles/vars/_base.scss";'
},
less: {
additionalData: '@import "@/styles/vars/_base.less";'
}
}
}
})