// 사용자가 PDF 보고서 누를 때만 로드
constPDFViewer=lazy(()=>import('./PDFViewer'));{showPDF&&(<Suspensefallback={<Spinner/>}><PDFViewerdoc={doc}/></Suspense>)}
Prefetch on hover
functionNavLink({to,importFn,children}){return(<Linkto={to}onMouseEnter={()=>importFn()}// chunk 미리
>{children}</Link>);}<NavLinkto="/dashboard"importFn={()=>import('./pages/Dashboard')}>대시보드</NavLink>
Webpack/Vite hint
// 항상 같이 쓸 chunk
constDashboard=lazy(()=>import(/* webpackPrefetch: true */'./pages/Dashboard'));// 자주 쓸 chunk
constHome=lazy(()=>import(/* webpackPreload: true */'./pages/Home'));