Upgraded NPM packages versions, fixed SVG loadings and removed DaisyUI
This commit is contained in:
parent
4717ff0767
commit
07bf5e1573
8 changed files with 2956 additions and 3845 deletions
32
src/frontend/vite.config.mts
Normal file
32
src/frontend/vite.config.mts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import react from "@vitejs/plugin-react-swc";
|
||||
import { defineConfig } from "vite";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
const apiRoutes = ["^/api/v1/", "/health"];
|
||||
|
||||
// Use environment variable to determine the target.
|
||||
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
|
||||
|
||||
// Use environment variable to determine the UI server port
|
||||
const port = Number(process.env.VITE_PORT) || 3000;
|
||||
|
||||
const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
|
||||
proxyObj[route] = {
|
||||
target: target,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
};
|
||||
return proxyObj;
|
||||
}, {});
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: "build",
|
||||
},
|
||||
plugins: [react(), svgr()],
|
||||
server: {
|
||||
port: port,
|
||||
proxy: {
|
||||
...proxyTargets,
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue