chore(vite): configure dev server and exact HMR client port for Docker environment
This commit is contained in:
@ -17,10 +17,14 @@ export default defineConfig({
|
|||||||
// 允许局域网访问前端页面
|
// 允许局域网访问前端页面
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 5173,
|
port: 5173,
|
||||||
|
strictPort: true,
|
||||||
|
watch: {
|
||||||
|
usePolling: true
|
||||||
|
},
|
||||||
https: true, // ★ [新增] 强制开启 HTTPS,否则浏览器会拦截摄像头
|
https: true, // ★ [新增] 强制开启 HTTPS,否则浏览器会拦截摄像头
|
||||||
hmr: {
|
hmr: {
|
||||||
protocol: 'wss',
|
protocol: 'wss',
|
||||||
clientPort: 5173
|
clientPort: 5175
|
||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
// 拦截所有以 /api 开头的请求
|
// 拦截所有以 /api 开头的请求
|
||||||
|
|||||||
Reference in New Issue
Block a user