From 4728f91cc7861e091f85552a6ffe33dd9957bc5d Mon Sep 17 00:00:00 2001 From: DXC Date: Mon, 13 Apr 2026 09:03:33 +0800 Subject: [PATCH] chore(vite): configure dev server and exact HMR client port for Docker environment --- inventory-web/vite.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inventory-web/vite.config.ts b/inventory-web/vite.config.ts index 99bf25e..0928950 100644 --- a/inventory-web/vite.config.ts +++ b/inventory-web/vite.config.ts @@ -17,10 +17,14 @@ export default defineConfig({ // 允许局域网访问前端页面 host: '0.0.0.0', port: 5173, + strictPort: true, + watch: { + usePolling: true + }, https: true, // ★ [新增] 强制开启 HTTPS,否则浏览器会拦截摄像头 hmr: { protocol: 'wss', - clientPort: 5173 + clientPort: 5175 }, proxy: { // 拦截所有以 /api 开头的请求