GCodeOverlay/vite.config.ts
sjat cbc11f3bb9 feat: wire CNC camera via same-origin /camera proxy, bolder overlay
- streamUrl -> relative /camera/mjpg/video.mjpg so the page loads the LAN-only
  CNC MJPEG cam same-origin (no mixed-content, no embedded creds). Vite
  dev-proxy added so the same path works under `npm run dev`.

- renderDefaults: thicker lines (lineWidth 3) and fully-saturated cut/rapid
  colors so the toolpath reads clearly over the video feed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 08:04:12 +02:00

19 lines
708 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
// 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/, ''),
},
},
},
test: { globals: true, environment: 'node' },
});