Next.js 정적빌드 하는 방법

ino5·2023년 10월 10일
0

23년 개인플젝

목록 보기
10/14

1. next.config.js 수정

프로젝트 최상단에 있는 next.config.js 파일에 output: 'export'를 넣어준다.

/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'export',
}

module.exports = nextConfig

2. npm run build 실행

npm run build

3. out 폴더 확인

out 폴더 내에 정적파일로 빌드된 것을 볼 수 있다.

4. S3 배포 예시

profile
지금은 네이버 블로그만 해요... https://blog.naver.com/chero77

0개의 댓글