From f769d73f738dfd7ab996a9cb16de3b1985363eaa Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Fri, 7 Nov 2025 08:35:30 +0100 Subject: [PATCH] feat: configure static generation for icon pages with development optimization - Add `revalidate = false` and `dynamic = "force-static"` exports - Add CI_MODE check in generateStaticParams to limit to 5 icons in local dev - This speeds up local development builds while maintaining full static generation in CI --- web/src/app/icons/[icon]/page.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/src/app/icons/[icon]/page.tsx b/web/src/app/icons/[icon]/page.tsx index f436e112..a222dddc 100644 --- a/web/src/app/icons/[icon]/page.tsx +++ b/web/src/app/icons/[icon]/page.tsx @@ -4,17 +4,26 @@ import { IconDetails } from "@/components/icon-details" import { BASE_URL, WEB_URL } from "@/constants" import { getAllIcons, getAuthorData } from "@/lib/api" import { AuthorData } from "@/types" + export const dynamicParams = false +export const revalidate = false +export const dynamic = "force-static" export async function generateStaticParams() { const iconsData = await getAllIcons() + if (process.env.CI_MODE === "false") { + // This is meant to speed up the build process in local development + return Object.keys(iconsData) + .slice(0, 5) + .map((icon) => ({ + icon, + })) + } return Object.keys(iconsData).map((icon) => ({ icon, })) } -export const dynamic = "force-static" - type Props = { params: Promise<{ icon: string }> searchParams: Promise<{ [key: string]: string | string[] | undefined }>