import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tsconfigPaths from "vite-tsconfig-paths"; // https://vite.dev/config/ export default defineConfig({ plugins: [ react({ babel: { plugins: [ 'react-dev-locator', ], }, }), tsconfigPaths(), ], server: { port: 5180, strictPort: true, proxy: { '/api': { target: 'http://localhost:3010', changeOrigin: true, secure: false, configure: (proxy) => { proxy.on('error', (err) => { console.log('proxy error', err); }); proxy.on('proxyReq', (_proxyReq, req) => { console.log('Sending Request to the Target:', req.method, req.url); }); proxy.on('proxyRes', (proxyRes, req) => { console.log('Received Response from the Target:', proxyRes.statusCode, req.url); }); }, }, '/uploads': { target: 'http://localhost:3010', changeOrigin: true, secure: false, } } } })