Files
gov/vite.config.ts

35 lines
996 B
TypeScript
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: {
port: 4175,
host: true, // Позволяет Vite слушать все сетевые интерфейсы (0.0.0.0)
strictPort: true,
allowedHosts: ['gov.iieasy.ru'], // Разрешаем внешний хост
proxy: {
// Все запросы, начинающиеся с /api, будут перенаправлены на бэкенд
'/api': {
target: 'http://127.0.0.1:3001',
changeOrigin: true,
secure: false,
},
},
},
preview: {
port: 4175,
host: true, // Также для режима preview
strictPort: true,
allowedHosts: ['gov.iieasy.ru'], // Разрешаем внешний хост для preview
proxy: {
'/api': {
target: 'http://127.0.0.1:3001',
changeOrigin: true,
secure: false,
},
},
},
});