kcg-monitoring/frontend/vite.config.ts
htlee 6c54500c70 feat: 센서 그래프 실데이터 + 선박 모달 UI 개선 + KST/UTC 라디오
- SensorChart: 백엔드 실데이터(지진/기압) + 동적 x축 시간 + 히스토리 10M/30M/1H/3H/6H
- LiveControls: KST/UTC 토글 → 라디오 버튼 그룹
- ShipLayer: 모달 고정크기(300px), 드래그 가능, S&P Global 다중사진 슬라이드
- 선박 모달 CSS 통일 (태그 스타일, 2컬럼 그리드, 긴 값 단독행)
- 센서 API: hours→min 파라미터 (기본 2880=48h), 인증 예외 처리
- useIranData/useKoreaData: 센서 10분 polling + 선박 60분 초기/6분 incremental merge

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:23:45 +09:00

111 lines
3.3 KiB
TypeScript

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'] } : {},
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': {
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,
},
},
},
}))