37 أسطر
887 B
JavaScript
37 أسطر
887 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// Client-Server Architecture Configuration
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
|
|
// Client-side configuration
|
|
server: {
|
|
port: 5173,
|
|
host: true,
|
|
|
|
// Development proxy to Python server
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8000', // Python Flask server
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/api/, '/api')
|
|
}
|
|
}
|
|
},
|
|
|
|
// Build configuration for production
|
|
build: {
|
|
outDir: '../dist',
|
|
emptyOutDir: true,
|
|
sourcemap: false
|
|
},
|
|
|
|
// Define environment variables
|
|
define: {
|
|
'import.meta.env.ARCHITECTURE': JSON.stringify('client-server'),
|
|
'import.meta.env.CLIENT': JSON.stringify('react'),
|
|
'import.meta.env.SERVER': JSON.stringify('python-flask')
|
|
}
|
|
}) |