- dynamic metadata
- 예시
-
export async function generateMetadata({ params: { todoId } }: Params): Promise<Metadata> { const todo: Todo = await getTodo(todoId); return { title: todo.title, }; }
- .env 지원
- default support dotenv
- .env.local (또는 .env.development.local)
- .env.development
- .env
- next.config.js
- process.env.customKey 로 사용 가능
module.exports = { env: { customKey: 'my-value', }, }
- 민감한 정보는 키 값 그대로 commit & push 하지 말 것
- default support dotenv
- remove console
- next.config.js 생성
- 형식
- removeConsole: true | {exclude: […]}
- 예시
const nextConfig = { compiler: { removeConsole: { exclude: ['error', 'debug'], }, }, };
- 형식
- build시 소스 코드의 console.log 자동 제거 해준다.
- next.config.js 생성
- Using TurboPack 사용
- package.json 수정
-
"scripts": { "dev": "next dev --port 3001", "dev:turbo": "next dev --turbo", "build": "next build", }
'Front-end > Next.js' 카테고리의 다른 글
JSON API 데이터 사용하기 (JSONPlaceholder) (0) | 2024.03.08 |
---|---|
[Next.js] React+Nest의 테스트(Jest & Test-Library) (0) | 2024.03.08 |
[Next.js] Error/Loading/Not-found Page (0) | 2024.03.08 |
[Next.js] NextAuth 소셜 로그인, openssl 설치 (0) | 2024.03.08 |
[Next.js] Server API, middleware (0) | 2024.03.08 |