CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Waiting to run
CI/CD Pipeline / Backend Build & Test (push) Waiting to run
CI/CD Pipeline / Admin Web Build (push) Waiting to run
CI/CD Pipeline / Mini Program Compile Check (push) Waiting to run
CI/CD Pipeline / Migration Validation (push) Blocked by required conditions
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Waiting to run
CI/CD Pipeline / E2E (live stack) (push) Blocked by required conditions
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vite'
|
||
import vue from '@vitejs/plugin-vue'
|
||
import { resolve } from 'path'
|
||
|
||
export default defineConfig(({ command }) => ({
|
||
plugins: [vue()],
|
||
// 管理端产物部署在 nginx 的 /admin/ 子路径下(见 infrastructure/nginx-production.conf
|
||
// 与 admin-web/nginx-admin.conf)。构建时必须带 /admin/ 前缀,否则 index.html 引用的
|
||
// /assets/*.js 会落到站点根路径,被生产 nginx 的其它 location 兜成 404 或错误页面。
|
||
// 开发服务器保持根路径:http://localhost:13520/ 的既有开发与排查习惯不变
|
||
// (vite 的 base 对 dev 与 build 各自生效,故此处按 command 分叉)。
|
||
base: command === 'build' ? '/admin/' : '/',
|
||
resolve: {
|
||
alias: {
|
||
'@': resolve(__dirname, 'src'),
|
||
},
|
||
},
|
||
server: {
|
||
// 本机开发端口。避开 3000/8080/8081/8085 等被其他项目占用的常用端口。
|
||
port: 13520,
|
||
// 允许同一局域网的浏览器访问开发页面。
|
||
host: '0.0.0.0',
|
||
// 端口被占用时直接失败,而不是静默 +1 退到 13521。
|
||
// 静默漂移会让「文档写 13520、实际跑在别的端口」这种不一致无法被发现。
|
||
strictPort: true,
|
||
proxy: {
|
||
'/api': {
|
||
target: 'http://localhost:8085',
|
||
changeOrigin: true,
|
||
},
|
||
},
|
||
},
|
||
}))
|