2023-11-10 17:45:10 +08:00
|
|
|
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:{
|
2023-12-14 18:29:40 +08:00
|
|
|
additionalData: '@import "./src/assets/css/variable.scss";' //引入scss文件
|
2023-11-10 17:45:10 +08:00
|
|
|
}
|
|
|
|
}
|
2024-03-13 16:54:09 +08:00
|
|
|
},
|
|
|
|
server: {
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2024-03-31 13:13:41 +08:00
|
|
|
//target: 'http://192.168.137.235:9999', // 目标服务器地址
|
2024-04-24 14:50:57 +08:00
|
|
|
target: 'http://192.168.1.110:9999', // 目标服务器地址
|
2024-03-13 16:54:09 +08:00
|
|
|
ws: true, // 是否启用 WebSocket
|
|
|
|
changeOrigin: true, // 是否修改请求头中的 Origin 字段
|
|
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
2024-03-16 12:00:13 +08:00
|
|
|
},
|
|
|
|
'/socket.io': {
|
2024-03-31 13:13:41 +08:00
|
|
|
//target: 'ws://192.168.137.235:9999',
|
2024-04-24 14:50:57 +08:00
|
|
|
target: 'ws://192.168.1.110:9999',
|
2024-03-16 12:00:13 +08:00
|
|
|
ws: true,
|
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path) => path.replace(/^\/socket.io/, ''),
|
|
|
|
},
|
2024-03-13 16:54:09 +08:00
|
|
|
}
|
2023-11-10 17:45:10 +08:00
|
|
|
}
|
|
|
|
})
|