mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-23 20:44:58 +08:00
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import {fileURLToPath, URL} from 'node:url'
|
|
|
|
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
// 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://127.0.0.1:6379', // 目标服务器地址
|
|
// target: 'http://110.41.142.124:6379', // 目标服务器地址
|
|
ws: true, // 是否启用 WebSocket
|
|
changeOrigin: true, // 是否修改请求头中的 Origin 字段
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
'/socket.io': {
|
|
target: 'ws://127.0.0.1:6379',
|
|
// target: 'ws://110.41.142.124:6379',
|
|
ws: true,
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/socket.io/, ''),
|
|
},
|
|
}
|
|
}
|
|
})
|