Files
goSSS-front/vite.config.ts

28 lines
949 B
TypeScript
Raw 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';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
// Важно для Docker/Remote контейнеров: слушать все интерфейсы
host: true,
// Явно задаем порт
port: 5173,
// Если порт занят, Vite выйдет с ошибкой, а не будет искать следующий
strictPort: true,
proxy: {
'/api': {
// Если бэкенд тоже запущен внутри этого контейнера на 9999:
target: 'http://etalon-server:9999',
// Если бэкенд на хост-машине, возможно понадобится http://host.docker.internal:9999
changeOrigin: true,
},
},
},
});