Files
GouJ b4e1e6873c fix: 优化移动端全屏侧栏
移动端侧栏改为全屏固定导航,关闭后释放全部正文宽度,并统一使用菜单图标入口。
2026-09-08 18:14:15 +08:00

33 lines
1.2 KiB
TypeScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
/** 开发代理保留 /api 前缀;长工作流不使用代理层的短超时。 */
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [vue(), tailwindcss()],
resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } },
server: {
/** 监听所有网卡,使 Vite 启动时输出可访问的局域网 IP。 */
host: true,
/** 允许 Work Mode 通过本地预览域名进行移动端视觉验收。 */
allowedHosts: ['terminal.local'],
port: 4312,
proxy: {
'/api': {
target: env.API_PROXY_TARGET || 'http://localhost:3412',
changeOrigin: true,
timeout: 0,
proxyTimeout: 0
},
'/storage': {
target: env.API_PROXY_TARGET || 'http://localhost:3412',
changeOrigin: true
}
}
}
}
})