kintex/src/frontend/vite.config.js

32 lines
1.0 KiB
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath, URL } from 'node:url';
// 백엔드(Spring Boot)는 기본 :8080. 개발 중 /api·/ws 프록시.
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 5173,
proxy: {
'/api': {
target: process.env.VITE_BACKEND_ORIGIN || 'http://localhost:8080',
changeOrigin: true,
},
// 관리자 업로드 정적 파일(로그인 슬라이드 이미지) — 백엔드가 서빙
'/uploads': {
target: process.env.VITE_BACKEND_ORIGIN || 'http://localhost:8080',
changeOrigin: true,
},
'/ws': {
target: process.env.VITE_BACKEND_ORIGIN || 'http://localhost:8080',
changeOrigin: true,
ws: true,
},
},
},
});