File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import {
22 ENABLE_STATIC_EXPORT ,
3- IS_DEV_ENV ,
43 NEXT_DATA_URL ,
5- VERCEL_ENV ,
6- VERCEL_REGION ,
4+ IS_NOT_VERCEL_RUNTIME_ENV ,
75} from '@/next.constants.mjs' ;
86import type { BlogCategory , BlogPostsRSC } from '@/types' ;
97
108const getBlogData = (
119 cat : BlogCategory ,
1210 page ?: number
1311) : Promise < BlogPostsRSC > => {
14- const IS_NOT_VERCEL_RUNTIME_ENV =
15- ( ! IS_DEV_ENV && VERCEL_ENV && ! VERCEL_REGION ) ||
16- ( ! IS_DEV_ENV && ! VERCEL_ENV ) ;
17-
1812 // When we're using Static Exports the Next.js Server is not running (during build-time)
1913 // hence the self-ingestion APIs will not be available. In this case we want to load
2014 // the data directly within the current thread, which will anyways be loaded only once
Original file line number Diff line number Diff line change 11import {
22 ENABLE_STATIC_EXPORT ,
3- IS_DEV_ENV ,
43 NEXT_DATA_URL ,
5- VERCEL_ENV ,
6- VERCEL_REGION ,
4+ IS_NOT_VERCEL_RUNTIME_ENV ,
75} from '@/next.constants.mjs' ;
86import { availableLocaleCodes } from '@/next.locales.mjs' ;
97import type { DownloadSnippet } from '@/types' ;
@@ -17,10 +15,6 @@ export default async function getDownloadSnippets(
1715 return [ ] ;
1816 }
1917
20- const IS_NOT_VERCEL_RUNTIME_ENV =
21- ( ! IS_DEV_ENV && VERCEL_ENV && ! VERCEL_REGION ) ||
22- ( ! IS_DEV_ENV && ! VERCEL_ENV ) ;
23-
2418 // When we're using Static Exports the Next.js Server is not running (during build-time)
2519 // hence the self-ingestion APIs will not be available. In this case we want to load
2620 // the data directly within the current thread, which will anyways be loaded only once
Original file line number Diff line number Diff line change 11import {
22 ENABLE_STATIC_EXPORT ,
3- IS_DEV_ENV ,
43 NEXT_DATA_URL ,
5- VERCEL_ENV ,
6- VERCEL_REGION ,
4+ IS_NOT_VERCEL_RUNTIME_ENV ,
75} from '@/next.constants.mjs' ;
86import type { NodeRelease } from '@/types' ;
97
108const getReleaseData = ( ) : Promise < Array < NodeRelease > > => {
11- const IS_NOT_VERCEL_RUNTIME_ENV =
12- ( ! IS_DEV_ENV && VERCEL_ENV && ! VERCEL_REGION ) ||
13- ( ! IS_DEV_ENV && ! VERCEL_ENV ) ;
14-
159 // When we're using Static Exports the Next.js Server is not running (during build-time)
1610 // hence the self-ingestion APIs will not be available. In this case we want to load
1711 // the data directly within the current thread, which will anyways be loaded only once
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ export const VERCEL_ENV = process.env.VERCEL_ENV || undefined;
2323 */
2424export const VERCEL_REGION = process . env . VERCEL_REGION || undefined ;
2525
26+ export const IS_NOT_VERCEL_RUNTIME_ENV =
27+ ( ! IS_DEV_ENV && VERCEL_ENV && ! VERCEL_REGION ) || ( ! IS_DEV_ENV && ! VERCEL_ENV ) ;
28+
2629/**
2730 * This is used for telling Next.js to do a Static Export Build of the Website
2831 *
You can’t perform that action at this time.
0 commit comments