Automatically prerendered content 실전 서브앱
sync I/O, module import, pure computation은 자동으로 static shell에 포함됩니다.
연산 유형을 토글해 자동 prerender 가능 여부가 어떻게 바뀌는지 확인해보세요.
파일 구조
cache-components/automatically-prerendered-content/ |- page.tsx \- demo/ \- page.tsx
핵심 코드
const content = fs.readFileSync('./config.json', 'utf-8')
const constants = await import('./constants.json')
const processed = JSON.parse(content).items.map((item) => item.value * 2)실전 점검 체크리스트
- - 동적 접근(fetch/runtime) 유무 확인
- - 순수 연산 경로 유지
- - layout/page 전체 조합으로 최종 판단