[#78] perf: 랜딩 페이지 번들 최적화#80
Merged
Merged
Conversation
* refactor: 네이버 맵 Application 변경 * fix: 네이버 유저 아이디 오타수정 * hotfix: 사업자번호 인증 API 오류로 인한 임시 모킹 처리 * docs: revise README with project overview and details Updated README to include project details, features, tech stack, installation instructions, performance optimizations, architecture, security, and team information. * docs: Update README to include service demo video Removed duplicate image tag and added service demo video link. * refactor: 랜딩 페이지 번들 최적화 개선 (#78) - LandingIntroSection/PaySection/DocSection 아이콘 8개 lazy 분리 chunk-landing 2,487kB → 11kB (99.6% 감소) - LandingIntroLazy/PayLazy/DocLazy min-height 추가 height:0 div로 Intersection Observer 즉시 trigger 되던 버그 수정 - FeatureCard Suspense 누락 버그 수정 lazy 아이콘이 상위 App Suspense로 탈출해 전체 화면 교체되던 문제 해결 - Landing.tsx LogoIcon을 static import으로 전환 (CLS 방지) - App.tsx HomeBoss/HomeStaff/HomeAdmin lazy 전환 manualChunks chunk-home 규칙과 static import 불일치 해소 - vite.config.ts vendor-others 세분화 firebase/charts/toss 별도 청크 분리 (921kB → 673kB) Lighthouse Mobile 3회 평균 기준 FCP 13.3s → 7.0s (▼47%), TBT 1,407ms → 710ms (▼50%)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
개요
랜딩 페이지 초기 로딩 성능 문제를 분석하고, 번들 구조를 개선했습니다.
rollup-plugin-visualizer로 번들 treemap을 시각화한 결과, 비로그인 방문자에게 불필요한 코드가 대량 전달되고 있었습니다.Lighthouse Mobile 3회 평균 (vite preview 기준)
변경 사항
1. 랜딩 섹션 아이콘 8개 lazy 분리 —
chunk-landing 2,487kB → 11kBLandingIntroSection/LandingPaySection/LandingDocSection내 SVG 아이콘들이 static import로 묶여 chunk-landing에 전부 포함되고 있었습니다.각 아이콘을
React.lazy로 전환해 스크롤 진입 시 개별 로딩하도록 변경했습니다.2.
LandingIntroLazy/LandingPayLazy/LandingDocLazy—min-height추가감지 대상 div의 height가 0이어서 Intersection Observer가 스크롤 없이 즉시 trigger 되던 버그를 수정했습니다.
min-h-[400px]을 지정해 실제 뷰포트 진입 시에만 로딩되도록 수정했습니다.3.
FeatureCard.tsx—Suspense누락 버그 수정lazy 아이콘에 Suspense boundary가 없어 로딩 중 가장 가까운 상위 Suspense(
App.tsx)로 탈출하고 있었습니다.랜딩 전체가
FullScreenLoading으로 교체되는 문제를 각 아이콘에 개별 Suspense를 추가해 수정했습니다.4.
Landing.tsx—LogoIconstatic import 전환히어로 영역 최상단 로고를 lazy +
fallback={null}로 처리하고 있어, 초기 렌더 시 로고가 없다가 나타나는 CLS를 유발하고 있었습니다.static import로 전환해 CLS를 제거했습니다.
5.
App.tsx—HomeBoss/HomeStaff/HomeAdminlazy 전환vite.config.ts에chunk-home분리 규칙이 있었지만, 세 컴포넌트가 static import 상태여서 규칙이 동작하지 않았습니다.lazy로 전환해 랜딩 방문자(비로그인)가 역할별 홈 화면 코드를 다운로드하지 않도록 했습니다.
6.
vite.config.ts—vendor-others세분화Firebase / Chart.js / Toss SDK가 모두
vendor-others에 묶여 있었습니다.각 라이브러리를 별도 청크로 분리해
vendor-others921kB → 673kB로 감소했습니다.번들 크기 변화