Spaces:
Sleeping
Sleeping
| import path from "node:path" | |
| import { defineConfig } from "vite" | |
| import react from "@vitejs/plugin-react" | |
| import tailwindcss from "@tailwindcss/vite" | |
| // The dashboard is served by gradio.Server in production (built assets in dist/). | |
| // In dev, Vite proxies API + media calls to the running gradio.Server on :7860. | |
| export default defineConfig({ | |
| plugins: [react(), tailwindcss()], | |
| resolve: { | |
| alias: { "@": path.resolve(__dirname, "./src") }, | |
| }, | |
| server: { | |
| port: 5173, | |
| proxy: { | |
| "/gradio_api": { target: "http://127.0.0.1:7860", changeOrigin: true, ws: true }, | |
| "/media": { target: "http://127.0.0.1:7860", changeOrigin: true }, | |
| "/config": { target: "http://127.0.0.1:7860", changeOrigin: true }, | |
| "/upload": { target: "http://127.0.0.1:7860", changeOrigin: true }, | |
| }, | |
| }, | |
| build: { | |
| outDir: "dist", | |
| emptyOutDir: true, | |
| }, | |
| }) | |