Files
sb-front/vite.config.js
ByungCheol cb5cf1f0bf
CI / build (push) Failing after 12m35s
feat: 브랜드 앱 아이콘 + Windows 데스크톱(Electron) 클라이언트
- 앱 아이콘: 브랜드(초록 #00bc7e + 흰 막대 차트) 적응형 아이콘 생성(@capacitor/assets)
  · assets/ 에 SVG 소스 + 전 해상도 mipmap 재생성, 적응형 XML 인셋 제거(배경 풀블리드)
- 데스크톱: Electron 로 dist 를 감싼 Windows 설치파일(.exe)
  · vite electron 모드(상대 base)·라우터 해시 히스토리·App 게이트 Electron 감지
  · webSecurity:false 로 file:// CORS 우회, 백엔드는 https://app.sblog.kr/api
  · scripts: build:electron / electron:dev / electron:build(electron-builder NSIS)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:20:55 +09:00

43 lines
1.3 KiB
JavaScript

import { fileURLToPath, URL } from 'node:url'
import { readFileSync } from 'node:fs'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// 앱 버전 정보(설정 > 앱 버전)에 노출 — package.json 을 단일 출처로 사용
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8'))
// https://vite.dev/config/
export default defineConfig(({ mode }) => ({
// Electron(데스크톱)은 file:// 로 로드하므로 상대경로 자산이 필요. 그 외(웹/Capacitor)는 '/'.
base: mode === 'electron' ? './' : '/',
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
build: {
// 마크다운 에디터(toast-ui ~1MB)는 게시판 작성/상세 라우트에서만 동적 로딩되어
// 메인 번들에 포함되지 않는다. 의도된 지연 청크이므로 경고 한도를 현실적으로 상향.
chunkSizeWarningLimit: 1200,
},
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
port: 5173,
proxy: {
// /api 로 시작하는 요청을 Spring Boot(8080)로 프록시
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
},
},
},
}))