Files
XCDesktop/vite.config.ts

36 lines
889 B
TypeScript
Raw Permalink Normal View History

2026-03-08 01:34:54 +08:00
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);
});
},
}
}
}
})