Skip to content

Commit 08faedc

Browse files
committed
Configure Next.js for static export with force-static routing
1 parent 934e58e commit 08faedc

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
44
/* config options here */
5+
output: 'export',
56
};
67

78
export default nextConfig;

src/app/robots.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { MetadataRoute } from "next";
22

3+
export const dynamic = 'force-static';
4+
35
export default function robots(): MetadataRoute.Robots {
46
const siteUrl = process.env.SITE_URL;
57
return {

src/app/sitemap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { MetadataRoute } from "next";
22
import { siteConfig } from "@/lib/config";
33
import { isInternalHref } from "@/lib/utils";
44

5+
export const dynamic = 'force-static';
6+
57
export default function sitemap(): MetadataRoute.Sitemap {
68
const rawSiteUrl = process.env.SITE_URL || "";
79
const siteUrl = rawSiteUrl.replace(/\/$/, ""); // remove trailing slash

0 commit comments

Comments
 (0)