trustgraph/ts/packages/workbench/vite.config.ts

44 lines
964 B
TypeScript
Raw Normal View History

2026-04-05 22:44:45 -05:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import path from "path";
2026-06-06 10:33:10 -05:00
const isWorkbenchQa = process.env.WORKBENCH_QA === "1";
2026-04-05 22:44:45 -05:00
export default defineConfig({
2026-06-06 10:33:10 -05:00
plugins: [
react(),
tailwindcss(),
{
name: "trustgraph-workbench-qa-otel",
configureServer(server) {
if (!isWorkbenchQa) return;
server.middlewares.use("/otel", (_request, response) => {
response.statusCode = 204;
response.end();
});
},
},
],
2026-04-05 22:44:45 -05:00
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
proxy: {
2026-06-01 16:22:25 -05:00
"/api/v1/rpc": {
2026-04-05 22:44:45 -05:00
target: "ws://localhost:8088/",
ws: true,
},
"/api/v1": {
target: "http://localhost:8088/",
},
2026-06-01 16:22:25 -05:00
"/otel": {
target: "http://localhost:4328/",
rewrite: (p) => p.replace(/^\/otel/, ""),
},
2026-04-05 22:44:45 -05:00
},
},
});