Only statically optimize in production
This commit is contained in:
parent
cdb2ab5215
commit
1ffff2b6f6
@ -11,7 +11,7 @@ import { isNextImageReadyBasedOnPhotos } from '@/photo';
|
||||
export let generateStaticParams:
|
||||
(() => Promise<{ photoId: string }[]>) | undefined = undefined;
|
||||
|
||||
if (STATICALLY_OPTIMIZED_OG_IMAGES) {
|
||||
if (STATICALLY_OPTIMIZED_OG_IMAGES && process.env.NODE_ENV === 'production') {
|
||||
generateStaticParams = async () => {
|
||||
const photos = await getPhotoIds({ limit: GENERATE_STATIC_PARAMS_LIMIT });
|
||||
return photos.map(photoId => ({ photoId }));
|
||||
|
||||
@ -18,7 +18,7 @@ import { GENERATE_STATIC_PARAMS_LIMIT, getPhotoIds } from '@/photo/db';
|
||||
export let generateStaticParams:
|
||||
(() => Promise<{ photoId: string }[]>) | undefined = undefined;
|
||||
|
||||
if (STATICALLY_OPTIMIZED_PAGES) {
|
||||
if (STATICALLY_OPTIMIZED_PAGES && process.env.NODE_ENV === 'production') {
|
||||
generateStaticParams = async () => {
|
||||
const photos = await getPhotoIds({ limit: GENERATE_STATIC_PARAMS_LIMIT });
|
||||
return photos.map(photoId => ({ photoId }));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user