mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-23 20:44:58 +08:00
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: '/medical/',
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
css:{
|
|
preprocessorOptions:{
|
|
scss:{
|
|
additionalData: '@import "./src/assets/css/variable.scss";' //引入scss文件
|
|
}
|
|
}
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
//target: 'http://192.168.137.235:9999', // 目标服务器地址
|
|
target: 'http://192.168.1.117:9999', // 目标服务器地址
|
|
ws: true, // 是否启用 WebSocket
|
|
changeOrigin: true, // 是否修改请求头中的 Origin 字段
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
'/socket.io': {
|
|
//target: 'ws://192.168.137.235:9999',
|
|
target: 'ws://192.168.1.117:9999',
|
|
ws: true,
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/socket.io/, ''),
|
|
},
|
|
}
|
|
}
|
|
})
|