Skip to content

Commit 68d6974

Browse files
fix(build): skip product static params on Netlify to avoid DB calls
1 parent 08d9565 commit 68d6974

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • frontend/app/[locale]/shop/products/[slug]

frontend/app/[locale]/shop/products/[slug]/page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ import { formatMoney } from "@/lib/shop/currency";
1212
import { Link } from "@/i18n/routing";
1313
import { locales } from "@/i18n/config";
1414

15+
const shouldSkipStaticParams =
16+
process.env.NETLIFY === "true" ||
17+
process.env.SKIP_BUILD_STATIC_PARAMS === "true";
18+
1519
export async function generateStaticParams() {
20+
if (shouldSkipStaticParams) {
21+
return [];
22+
}
23+
1624
const all: { locale: string; slug: string }[] = [];
1725

1826
for (const locale of locales) {

0 commit comments

Comments
 (0)