Files
workspace/code/fms/fms-vue/vite.config.js
T
2026-08-25 22:44:36 +08:00

30 lines
809 B
JavaScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
host: true,
port: 5082,
strictPort: true,
watch: {
// 忽略工具原子写入产生的临时文件(形如 .xxx.tmpdir\xxx.tmp),
// 避免 Windows 下 fs.watch 对瞬时存在的临时路径抛 EBUSY 导致 dev server 崩溃
ignored: [/[\\/]\.tmpdir[\\/]/, /\.tmp$/],
},
// 开发环境将 /api 请求代理到后端服务(与 fms-vue-old2 保持一致)
proxy: {
'/api': {
target: 'http://127.0.0.1:8088',
changeOrigin: true,
},
},
},
plugins: [vue()],
})