migrating to Vite
This commit is contained in:
parent
4853a701d3
commit
2f8a6e3256
21 changed files with 1347 additions and 13727 deletions
34
src/frontend/vite.config.ts
Normal file
34
src/frontend/vite.config.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
|
||||
const apiRoutes = [
|
||||
'/all',
|
||||
'/predict',
|
||||
'^/validate/*',
|
||||
'^/chat/*',
|
||||
];
|
||||
|
||||
const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
|
||||
proxyObj[route] = {
|
||||
target: 'http://127.0.0.1:7860',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
};
|
||||
return proxyObj;
|
||||
}, {});
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
build: {
|
||||
outDir: 'build',
|
||||
},
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
...proxyTargets
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue