36 lines
889 B
TypeScript
36 lines
889 B
TypeScript
|
|
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: [],
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
tsconfigPaths(),
|
||
|
|
],
|
||
|
|
server: {
|
||
|
|
proxy: {
|
||
|
|
'/api': {
|
||
|
|
target: 'http://localhost:3001',
|
||
|
|
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);
|
||
|
|
});
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|