2026-07-11 23:13:10 +08:00
|
|
|
// =============================================================================
|
|
|
|
|
// 企微IT智能服务台 — 终端前端 Vite 配置
|
|
|
|
|
// =============================================================================
|
|
|
|
|
// 说明:小鱼易联终端大屏页面构建配置
|
|
|
|
|
// - base: /terminal/ (生产环境 nginx 路由前缀)
|
|
|
|
|
// - port: 5176(本地开发端口)
|
|
|
|
|
// - proxy: /itportal, /api, /ws → 后端 http://localhost:8000
|
|
|
|
|
// =============================================================================
|
|
|
|
|
|
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
import path from 'path'
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [vue()],
|
2026-07-13 02:17:03 +08:00
|
|
|
base: '/itterminal/',
|
2026-07-11 23:13:10 +08:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, 'src'),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
port: 5176,
|
|
|
|
|
host: '0.0.0.0',
|
|
|
|
|
proxy: {
|
|
|
|
|
// 会议室预定API(终端+H5共用)
|
|
|
|
|
'/itportal': {
|
|
|
|
|
target: 'http://localhost:8000',
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
// 统一认证API
|
|
|
|
|
'/api': {
|
|
|
|
|
target: 'http://localhost:8000',
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
// WebSocket
|
|
|
|
|
'/ws': {
|
|
|
|
|
target: 'ws://localhost:8000',
|
|
|
|
|
ws: true,
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
outDir: 'dist',
|
|
|
|
|
// 终端大屏设备,不生成 sourcemap(生产优化)
|
|
|
|
|
sourcemap: false,
|
|
|
|
|
// chunk 大小警告阈值(终端页面资源较少,设为 500KB)
|
|
|
|
|
chunkSizeWarningLimit: 500,
|
|
|
|
|
},
|
|
|
|
|
})
|