migrating to Vite

This commit is contained in:
Your Name 2023-05-10 23:30:09 +05:30 • committed by Sai Vinay G
commit 2f8a6e3256
21 changed files with 1347 additions and 13727 deletions

View 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
}
},
};
});