25 lines
700 B
TypeScript
25 lines
700 B
TypeScript
import { defineConfig, loadEnv } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd());
|
|
|
|
return {
|
|
plugins: [react()],
|
|
esbuild: {
|
|
minifyIdentifiers: false, // Отключаем переименование переменных
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ['lucide-react'],
|
|
},
|
|
server: {
|
|
host: true, // <-- добавлено: позволяет Vite принимать запросы извне (из Nginx)
|
|
proxy: {
|
|
'/api': {
|
|
target: env.VITE_API_URL || 'http://localhost:3001',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}); |