import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // The build lands inside the Go module, not in this directory. // // `go:embed` cannot reach outside its own module, and the server ships as ONE // binary on purpose - a second artefact to deploy is a second thing to forget // to deploy, the same argument that keeps `provision` a subcommand rather than // its own image. export default defineConfig({ plugins: [react()], build: { outDir: '../server/internal/web/dist', emptyOutDir: true, }, server: { // shared/cameraMakes.js lives above this directory and is imported by both // front ends; dev-server file serving is confined to the project root // unless told otherwise, so `npm run dev` would 403 on it. fs: { allow: ['..'] }, // `npm run dev` for styling work talks to a server run locally. The built // bundle uses same-origin paths and needs no proxy. proxy: { '/api': { target: 'http://127.0.0.1:8080', changeOrigin: true } }, }, })