Files
go-otel/otel-ui/vite.config.ts
T
2026-09-19 14:13:43 +02:00

40 lines
1.1 KiB
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
const target = process.env.OTEL_URL ?? "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,
},
},
},
});