Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(docs): skip static page generation for reference docs on preview builds

Greg Richardsonabbb109f287e
diff --git a/apps/docs/lib/mdx/handleRefStaticPaths.tsx b/apps/docs/lib/mdx/handleRefStaticPaths.tsx
index f458f4f3e8b..476dce8e22d 100644
--- a/apps/docs/lib/mdx/handleRefStaticPaths.tsx
+++ b/apps/docs/lib/mdx/handleRefStaticPaths.tsx
@@ -1,6 +1,15 @@
import { ICommonSection } from '~/components/reference/Reference.types'
async function handleRefGetStaticPaths(sections: ICommonSection[]) {
+ // In preview environments, don't generate static pages (faster builds)
+ if (process.env.SKIP_BUILD_STATIC_GENERATION) {
+ return {
+ paths: [],
+ fallback: 'blocking',
+ }
+ }
+
+ // In production, generate static pages for every sub-section (better SEO)
return {
paths: sections.map((section) => {
return {