본문 바로가기

JavaScript/Next.js

Next.js Scripts

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "lint": "next lint"
}

 

  • dev - Next.js를 development 모드로 실행 (.next과 이외 파일들을 참조)
  • build - 프로덕션 사용을 위한 애플리케이션을 빌드, 결과물: build/.next/
  • start - 빌드된 .next를 실행(build/.next를 실행)

즉 개발모드에선 dev를 실행하면 되고,

배포할 경우 build를 통해 .next 폴더를 최적화 한 후 yarn start를 통해 빌드된 .next를 실행시킨다.

'JavaScript > Next.js' 카테고리의 다른 글

Pages 번역  (0) 2021.11.19
내가 정리하는 Next.js  (0) 2021.11.06
Next.js 에서 https 사용법  (0) 2021.11.03
React.js와 Next.js의 서버 배포 차이  (0) 2021.10.22
Next.js "window,document is not defined" 해결하는 법  (0) 2021.06.03