Spaces:
Runtime error
Runtime error
| import { defineConfig } from 'vite' | |
| import react from '@vitejs/plugin-react' | |
| // https://vitejs.dev/config/ | |
| export default defineConfig({ | |
| plugins: [react()], | |
| esbuild: { | |
| loader: 'jsx', | |
| include: /src\/.*\.[jt]sx?$/, | |
| exclude: [], | |
| }, | |
| optimizeDeps: { | |
| esbuildOptions: { | |
| loader: { | |
| '.js': 'jsx', | |
| }, | |
| }, | |
| }, | |
| server: { | |
| port: 3001, | |
| proxy: { | |
| '/api': { | |
| target: 'http://localhost:7860', | |
| changeOrigin: true, | |
| secure: false, | |
| configure: (proxy, options) => { | |
| proxy.on('error', (err, req, res) => { | |
| console.log('proxy error', err); | |
| }); | |
| proxy.on('proxyReq', (proxyReq, req, res) => { | |
| console.log('Sending Request to the Target:', req.method, req.url); | |
| }); | |
| proxy.on('proxyRes', (proxyRes, req, res) => { | |
| console.log('Received Response from the Target:', proxyRes.statusCode, req.url); | |
| }); | |
| }, | |
| } | |
| } | |
| }, | |
| build: { | |
| outDir: 'dist', | |
| assetsDir: 'assets', | |
| } | |
| }) | |