Files
mediaproc/ui/chunker/vite.config.ts
2026-03-15 16:03:53 -03:00

51 lines
1.1 KiB
TypeScript

import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
base: "/chunker/",
plugins: [react()],
resolve: {
alias: {
"@protobuf-ts/runtime": path.resolve(
__dirname,
"node_modules/@protobuf-ts/runtime",
),
"@protobuf-ts/runtime-rpc": path.resolve(
__dirname,
"node_modules/@protobuf-ts/runtime-rpc",
),
"@protobuf-ts/grpcweb-transport": path.resolve(
__dirname,
"node_modules/@protobuf-ts/grpcweb-transport",
),
},
},
server: {
host: "0.0.0.0",
port: 5174,
allowedHosts: process.env.VITE_ALLOWED_HOSTS?.split(",") || [],
hmr: {
path: "/chunker/@vite/client",
},
fs: {
allow: [".."],
},
proxy: {
"/api": {
target: "http://fastapi:8702",
changeOrigin: true,
},
"/graphql": {
target: "http://fastapi:8702",
changeOrigin: true,
},
"/grpc-web": {
target: "http://envoy:8090",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/grpc-web/, ""),
},
},
},
});