Spaces:
Running
Running
| import { defineConfig } from "vite"; | |
| import react from "@vitejs/plugin-react"; | |
| import path from "path"; | |
| export default defineConfig({ | |
| plugins: [react()], | |
| resolve: { | |
| alias: { | |
| "@": path.resolve(__dirname, "./src"), | |
| }, | |
| }, | |
| build: { | |
| outDir: "dist", | |
| emptyOutDir: true, | |
| rollupOptions: { | |
| cache: true, | |
| output: { | |
| manualChunks: { | |
| vendor: ["react", "react-dom"], | |
| shadcn: [ | |
| "@radix-ui/react-dialog", | |
| "cmdk", | |
| "@radix-ui/react-tabs", | |
| "@radix-ui/react-accordion", | |
| ], | |
| query: ["@tanstack/react-query"], | |
| }, | |
| }, | |
| }, | |
| }, | |
| server: { | |
| host: "0.0.0.0", | |
| port: 3001, | |
| proxy: { | |
| "/api": { | |
| target: "http://backend:7860", | |
| changeOrigin: true, | |
| secure: false, | |
| configure: (proxy, _options) => { | |
| proxy.on("error", (err, req, res) => { | |
| console.log("proxy error", err); | |
| }); | |
| proxy.on("proxyReq", (proxyReq, req, _res) => { | |
| console.log("Proxying to backend:", req.method, req.url); | |
| }); | |
| }, | |
| timeout: 60000, | |
| }, | |
| }, | |
| }, | |
| }); | |