Files
go-otel/otel-ui/vite.config.ts
T
matsandClaude Sonnet 5 bd17837663
Build and Publish / Metadata (push) Successful in 2s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 58s
Add device-grant dev sign-in (CRD-driven) for local/agent development
AuthClient dev-console + AuthServer deviceFlow via k8s/auth-dev.yaml; otel
server accepts its own URL as an extra audience (OTEL_OIDC_AUDIENCE). Vite
dev-only device-flow sign-in, scripts/dev-auth.mjs helper, AGENTS.md notes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 09:08:46 +00:00

40 lines
1.0 KiB
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
const target = "https://otel.k6n.net";
// Device-grant issuer for local/agent development (see src/dev/device-auth.ts).
// Proxied same-origin so the browser needs no CORS and no issuer URL.
const authIssuer = process.env.AUTH_DEV_BASE ?? "https://users.k6n.net";
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
build: {
// Upload these maps to the receiver during deployment; do not publish
// them with the static UI.
sourcemap: true,
},
server: {
proxy: {
"/api": {
target: target,
changeOrigin: true,
},
"/dev-auth": {
target: authIssuer,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev-auth/, "/api/auth"),
},
"/auth_callback": {
target: target,
changeOrigin: true,
},
"/ws": {
target: target,
ws: true,
},
},
},
});