🗒️

【Next.js】メモ

2024/07/06に公開

Shell

# ----< 作成 >----
# "https://ja.next-community-docs.dev/docs/app-router/api-reference/create-next-app"

## pt.1 デフォルト (非対話:オプション指定)("your-project-name"は適宜変更する)
npx create-next-app@latest your-project-name \
--ts --tailwind --eslint --src-dir --app --import-alias '@/*'

## pt.2 対話的("your-project-name"は適宜変更する)
npx create-next-app@latest your-project-name
### オプション設定値は基本下記で良いと思う
✔ Would you like to use TypeScript? … Yes
✔ Would you like to use ESLint? … Yes
✔ Would you like to use Tailwind CSS? … Yes
✔ Would you like to use `src/` directory? … Yes
✔ Would you like to use App Router? (recommended) … Yes
✔ Would you like to customize the default import alias (@/*)? … No

## pt.3 "--example"オプションを使用 
npx create-next-app@latest nextjs-blog --use-npm --example "xxx"

# ----< 起動 >----
## 1.対象プロジェクトのディレクトリへ移動 
## 2.アプリの起動
npm run dev
## 3."http://localhost:3000"で確認

# ----< 終了 >----
## `control + C`

ドキュメント

https://nextjs.org/docs

Discussion