728x90
next.js 13버전 때 학습내용 정리 문서로 현재와 다름 주의
Static Assets
public 디렉토리에 정적 파일을 넣고 제공할 수 있음
import Image from 'next/image';
function Avatar() {
return <Image src="/me.png" alt="me" width="64" height="64" />;
}
export default Avatar;
위 예제에서 me.png는 /public/me.png 에 위치
- 정적자산은 s3나 cdn등을 사용하여 별도 분리해주는 것이 좋음.
- 업로드 파일도 마찬가지
'공부공부 > Next.js 공식문서' 카테고리의 다른 글
[next.js 공식문서] 22. Analytics (0) | 2024.03.05 |
---|---|
[next.js 공식문서] 21. Lazy Loading (0) | 2024.03.04 |
[next.js 공식문서] 19. Metadata (0) | 2024.03.03 |
[next.js 공식문서] 18. Script Optimization (0) | 2024.03.03 |
[next.js 공식문서] 17. Server Actions (0) | 2024.03.01 |