kcg-monitoring/frontend/vite.config.ts
htlee e11caf2767 feat: 어구 모선 추적 흐름도 시각화 (React Flow) 추가
- GearParentFlowViewer: React Flow 기반 인터랙티브 흐름도
- gear-parent-flow.html: standalone entry point
- vite.config.ts: multi-entry 빌드 (main + gearParentFlow)
- App.tsx: FLOW 링크 추가
- @xyflow/react 의존성 추가

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 01:19:21 +09:00

150 lines
4.5 KiB
TypeScript

import { resolve } from 'node:path'
import { defineConfig, type UserConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig(({ mode }): UserConfig => ({
plugins: [tailwindcss(), react()],
esbuild: mode === 'production' ? { drop: ['console', 'debugger'] } : {},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
gearParentFlow: resolve(__dirname, 'gear-parent-flow.html'),
},
},
},
server: {
proxy: {
'/api/ais': {
target: 'https://aisapi.maritime.spglobal.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/ais/, ''),
secure: true,
},
'/api/rss': {
target: 'https://news.google.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/rss/, ''),
secure: true,
},
'/api/gdelt': {
target: 'https://api.gdeltproject.org',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/gdelt/, ''),
secure: true,
},
'/api/nitter1': {
target: 'https://xcancel.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/nitter1/, ''),
secure: true,
},
'/api/nitter2': {
target: 'https://nitter.privacydev.net',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/nitter2/, ''),
secure: true,
},
'/api/nitter3': {
target: 'https://nitter.poast.org',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/nitter3/, ''),
secure: true,
},
'/api/rsshub': {
target: 'https://rsshub.app',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/rsshub/, ''),
secure: true,
},
'/api/overpass': {
target: 'https://overpass-api.de',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/overpass/, ''),
secure: true,
},
'/api/khoa-hls': {
target: 'https://www.khoa.go.kr',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/khoa-hls/, ''),
secure: true,
},
'/api/kbs-hls': {
target: 'https://kbsapi.loomex.net',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/kbs-hls/, ''),
secure: true,
},
'/api/twsyndication': {
target: 'https://syndication.twitter.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/twsyndication/, ''),
secure: true,
},
'/api/publish-twitter': {
target: 'https://publish.twitter.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/publish-twitter/, ''),
secure: true,
},
'/api/celestrak': {
target: 'https://celestrak.org',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/celestrak/, ''),
secure: true,
headers: {
'User-Agent': 'Mozilla/5.0 (compatible; KCG-Monitor/1.0)',
},
},
'/api/kcg/cctv': {
target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/kcg/, '/api'),
},
'/api/kcg': {
target: 'https://kcg.gc-si.dev',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/kcg/, '/api'),
secure: true,
},
'/signal-batch': {
target: 'https://wing.gc-si.dev',
changeOrigin: true,
secure: false,
},
'/shipimg': {
target: 'https://wing.gc-si.dev',
changeOrigin: true,
secure: false,
},
'/api/prediction-chat': {
target: 'https://kcg.gc-si.dev',
changeOrigin: true,
secure: true,
},
'/api/prediction/': {
target: 'http://192.168.1.18:8001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/prediction/, '/api'),
},
'/ollama': {
target: 'http://localhost:11434',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/ollama/, ''),
},
'/api/gtts': {
target: 'https://translate.google.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/gtts/, '/translate_tts'),
secure: true,
headers: {
'Referer': 'https://translate.google.com/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
},
},
},
},
}))