feat(mobile): stage 1 - infrastructure (vant, useDevice, MobileLayout, router, mobile.css)

- 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
This commit is contained in:
锦麟 王
2026-06-18 10:54:12 +08:00
parent 0b999eebb0
commit 38c13ec50e
9 changed files with 406 additions and 16 deletions
+19
View File
@@ -9,6 +9,25 @@ export default defineConfig({
'@': 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: {