Skip to content

Commit 965f1d1

Browse files
author
root
committed
fix: add force-static export to sitemap for static build compatibility
- Add 'export const dynamic = "force-static"' to sitemap.ts - Fixes Next.js static export build error when using output: export - Resolves make build-serve failing due to missing static export configuration
1 parent f12cc40 commit 965f1d1

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/app/sitemap.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { MetadataRoute } from 'next';
2+
3+
export const dynamic = 'force-static';
4+
5+
export default function sitemap(): MetadataRoute.Sitemap {
6+
const baseUrl = 'https://helpdev.com.br';
7+
const now = new Date();
8+
9+
const routes = ['/', '/services', '/about', '/articles', '/projects', '/blog', '/thanks'];
10+
11+
return routes.map((route) => ({
12+
url: `${baseUrl}${route}`,
13+
lastModified: now,
14+
changeFrequency: 'weekly',
15+
priority: route === '/' ? 1 : 0.8,
16+
}));
17+
}
18+

0 commit comments

Comments
 (0)