2026-06-08 22:08:36 +02:00
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-06-11 08:04:12 +02:00
|
|
|
// Dev-only: proxy the CNC MJPEG camera so the page can load it via a
|
|
|
|
|
// same-origin relative path (`/camera/...`), exactly as nginx does in
|
|
|
|
|
// production. Keeps `streamUrl` identical in dev and prod and avoids
|
|
|
|
|
// mixed-content / cross-origin issues. Override the target for a different
|
|
|
|
|
// camera with: VITE_CAMERA_TARGET=http://host npm run dev
|
|
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/camera': {
|
|
|
|
|
target: process.env.VITE_CAMERA_TARGET || 'http://172.17.3.38',
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/camera/, ''),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-06-08 22:08:36 +02:00
|
|
|
test: { globals: true, environment: 'node' },
|
|
|
|
|
});
|