Files

29 lines
756 B
TypeScript
Raw Permalink Normal View History

2026-10-19 20:36:22 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
// H5 演示端构建配置。
// - 开发端口 13521(strictPort;host:true 便于手机同局域网访问)
// - /api 代理到本机后端 8085(与 admin-web 同源策略)
// - build base=/h5/:产物部署在 nginx 的 /h5/ 子路径下(见 nginx-h5.conf)
export default defineConfig(({ command }) => ({
plugins: [vue()],
base: command === 'build' ? '/h5/' : '/',
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
server: {
port: 13521,
strictPort: true,
host: true,
proxy: {
'/api': {
target: 'http://localhost:8085',
changeOrigin: true,
},
},
},
}))