Next.js の Pages Routerのテンプレートです。
npm install
npm run dev
npm run build
テンプレートの設定では Next.js は SSR で実行されます。
SPA としてビルドする場合は next.config.ts
を編集してください。
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
reactStrictMode: true,
output: "export", // 追加
distDir: "out", // 追加
};
export default nextConfig;
# SPAとしてビルド
npm run build
# outディレクトリに出力した成果物を実行
npx serve out
フォーマットと静的解析には Biome を使用しています。
ルールの変更は biome.json
を編集してください。