🦋

【Next.js】個人的Next.js(Pages Router)の始め方

2024/07/07に公開

インストール

.で現在のディレクトリにインストール

npx create-next-app@latest .

選択

Would you like to use TypeScript? Yes
Would you like to use ESLint? Yes
Would you like to use Tailwind CSS? No
Would you like to use `src/` directory? Yes
Would you like to use App Router? (recommended) No
Would you like to customize the default import alias (@/*)? No

Sassのインストール

npm install --save-dev sass

リダイレクトの設定

next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  trailingSlash: true,
};

export default nextConfig;

Discussion