import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tsconfigPaths from "vite-tsconfig-paths";
import { traeBadgePlugin } from 'vite-plugin-trae-solo-badge';
// https://vite.dev/config/
export default defineConfig({
plugins: [
react({
babel: {
plugins: [
'react-dev-locator',
],
},
}),
traeBadgePlugin({
variant: 'dark',
position: 'bottom-right',
prodOnly: true,
clickable: true,
clickUrl: 'https://www.trae.ai/solo?showJoin=1',
autoTheme: true,
autoThemeTarget: '#root'
}),
tsconfigPaths(),
],
server: {
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
secure: false,
configure: (proxy) => {
proxy.on('proxyReq', (_proxyReq) => {
console.log('Proxying request to:', _proxyReq.path);
});
proxy.on('proxyRes', (_proxyRes, _req) => {
console.log('Received response from:', _req.url);
});
proxy.on('error', (_err) => {
console.error('Proxy error:', _err);
});
},
}
}
}
})