rax-medical/vite.config.ts

34 lines
773 B
TypeScript
Raw Normal View History

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': {
target: 'http://localhost:9999', // 目标服务器地址
ws: true, // 是否启用 WebSocket
changeOrigin: true, // 是否修改请求头中的 Origin 字段
rewrite: (path) => path.replace(/^\/api/, ''),
}
}
2023-11-10 17:45:10 +08:00
}
})