forked from GatlinHa/open-anylink-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
53 lines (51 loc) · 1.28 KB
/
vite.config.js
File metadata and controls
53 lines (51 loc) · 1.28 KB
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
48
49
50
51
52
53
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import svgLoader from 'vite-svg-loader'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx({
transformOn: true,
optimize: true
}),
svgLoader()
],
base: '/im',
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
// 配置代理
server: {
proxy: {
'/api': {
// 获取请求中带 /api 的请求
target: 'http://localhost:8080', // 后台服务器的源
changeOrigin: true // 修改源
},
'/ws': {
// 获取请求中带 /api 的请求
target: 'ws://localhost:8080', // 后台服务器的源
changeOrigin: true // 修改源
},
'/oss/': {
// 获取图片的请求
target: 'http://127.0.0.1:9001', // 对象存储oss的源
changeOrigin: true, // 修改源
rewrite: (path) => path.replace(/^\/oss\//, '')
}
}
},
// 屏蔽告警:The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
}
})