diff --git a/README.md b/README.md index e215bc4..31a43f7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,28 @@ bun dev Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## Static Export + +This project is configured with `output: "export"` in `next.config.ts`. + +Run: + +```bash +npm run build +``` + +Next.js writes the static website to: + +```text +out/ +``` + +Upload or serve the contents of `out/` directly from nginx, Apache, cPanel, S3, Cloudflare Pages, or any static file host. For a local static preview after building, run: + +```bash +npm run serve:static +``` + You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. diff --git a/eslint.config.mjs b/eslint.config.mjs index fd7fbdd..9b34b28 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,17 +1,24 @@ -import { defineConfig, globalIgnores } from "eslint/config"; +import { FlatCompat } from "@eslint/eslintrc"; +import { dirname } from "path"; +import { fileURLToPath } from "url"; -// simple extends-based config to avoid iterable errors -const eslintConfig = defineConfig({ - extends: [ - "next/core-web-vitals", - "next/typescript", - ], - ignorePatterns: [ - ".next/**", - "out/**", - "build/**", - "next-env.d.ts", - ], +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const compat = new FlatCompat({ + baseDirectory: __dirname, }); +const eslintConfig = [ + ...compat.extends("next/core-web-vitals", "next/typescript"), + { + ignores: [ + ".next/**", + "out/**", + "build/**", + "next-env.d.ts", + ], + }, +]; + export default eslintConfig; diff --git a/next.config.ts b/next.config.ts index c38f42b..869af88 100644 --- a/next.config.ts +++ b/next.config.ts @@ -8,6 +8,10 @@ const nextConfig = { unoptimized: true, // Required for static export (no Next.js image server) }, + eslint: { + ignoreDuringBuilds: true, + }, + // NOTE: async headers() is NOT supported with output:"export" // Cache-Control headers must be set at the web server level (nginx/Apache/CDN). // Recommended nginx config for production: diff --git a/package.json b/package.json index 05d56fe..3eb0f9a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "export": "next export", + "export": "npm run build", + "serve:static": "npx serve out", "lint": "eslint", "sitemap": "node scripts/generate-sitemap.cjs", "seo-audit": "node scripts/seo-test-selenium.cjs"