38c13ec50e
- add vant@^4.9.0 dependency - migrate useDevice.ts (device detection + localStorage) - migrate MobileLayout.vue (tabbar + navbar + store init) - migrate mobile.css (vant theme -> --gg-* mapping) - migrate Placeholder.vue for unimplemented mobile views - index.html: viewport for mobile (no-zoom, safe-area) - main.ts: register Vant + import mobile.css - vite.config.ts: manualChunks code splitting (vue/element/vant/pocketbase/livekit) - router/index.ts: device-based routing via isMobile() + view() helper, preserve uat's JoinGroup/JoinTeam routes, mobile views use Placeholder pending stages 2-11 build verified: vue-tsc + vite build pass
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite'
|
||
import vue from '@vitejs/plugin-vue'
|
||
import path from 'node:path'
|
||
|
||
export default defineConfig({
|
||
plugins: [vue()],
|
||
resolve: {
|
||
alias: {
|
||
'@': path.resolve(__dirname, 'src')
|
||
}
|
||
},
|
||
build: {
|
||
rollupOptions: {
|
||
output: {
|
||
// 代码分割:vendor 按依赖分组,避免单个超大 chunk
|
||
manualChunks: {
|
||
// Vue 核心运行时(vue + vue-router + pinia)
|
||
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
||
// 桌面端 UI 库
|
||
'element-plus': ['element-plus', '@element-plus/icons-vue'],
|
||
// 手机端 UI 库
|
||
'vant': ['vant'],
|
||
// 后端 SDK
|
||
'pocketbase': ['pocketbase'],
|
||
// 语音房依赖(仅 VoiceRoom 用到,体积大,单独拆分)
|
||
'livekit': ['livekit-client'],
|
||
}
|
||
}
|
||
}
|
||
},
|
||
server: {
|
||
port: Number(process.env.VITE_PORT) || 5173,
|
||
proxy: {
|
||
'/api': {
|
||
target: process.env.VITE_PB_URL || 'http://localhost:8090',
|
||
changeOrigin: true,
|
||
rewrite: (path) => path.replace(/^\/api/, '')
|
||
}
|
||
}
|
||
}
|
||
})
|