2026-07-21 15:28:55 +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: [
|
|
|
|
|
'react-dev-locator',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
tsconfigPaths(),
|
|
|
|
|
],
|
|
|
|
|
server: {
|
2026-07-21 17:13:08 +08:00
|
|
|
port: 5180,
|
|
|
|
|
strictPort: true,
|
2026-07-21 15:28:55 +08:00
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
2026-07-21 17:13:08 +08:00
|
|
|
target: 'http://localhost:3010',
|
2026-07-21 15:28:55 +08:00
|
|
|
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': {
|
2026-07-21 17:13:08 +08:00
|
|
|
target: 'http://localhost:3010',
|
2026-07-21 15:28:55 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
|
secure: false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|