[FIX]Vite manualChunks를 통한 핵심 라이브러리 우선 로딩 적용 #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
문제 상황
빌드시 초기에 내려보내는 번들의 크기가 너무 큼
문제 원인
vite.config.ts에서 아무런 설정없이, 모든 라이브러리를 초기 로딩시 전부 로딩
해결 방법
react-vendor: React 핵심 라이브러리 (자주 변경되지 않음)
router: 라우팅 기능 (페이지 전환 시에만 필요)
ui: UI 컴포넌트들 (사용자 인터랙션 시 필요)
state: 상태 관리 (애플리케이션 전반에 걸쳐 사용)
network: 네트워크 통신 (API 호출 시에만 필요)
utils: 유틸리티 함수들 (필요에 따라 사용)
으로 6가지로 카테고리화 및, 초기로딩시 핵심 라이브러리만 로딩 진행
성능개선(Local 환경기준, Web Vitals 라이브러리로 측정)