11'use strict' ;
22import createNextIntlPlugin from 'next-intl/plugin' ;
33
4- import { BASE_PATH , ENABLE_STATIC_EXPORT } from './next.constants.mjs' ;
4+ import {
5+ BASE_PATH ,
6+ ENABLE_STATIC_EXPORT ,
7+ OPEN_NEXT_CLOUDFLARE ,
8+ } from './next.constants.mjs' ;
59import { redirects , rewrites } from './next.rewrites.mjs' ;
610
711/** @type {import('next').NextConfig } */
@@ -20,12 +24,7 @@ const nextConfig = {
2024 // (https://developers.cloudflare.com/images/transform-images/sources/)
2125 // in the Cloudflare dashboard itself instead (to the exact same values present in `remotePatterns` below).
2226 //
23- // TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being
24- // defined in the worker building script, ideally the open-next
25- // adapter should set it itself when it invokes the Next.js build
26- // process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE`
27- // definition in the package.json script.
28- process . env . OPEN_NEXT_CLOUDFLARE
27+ OPEN_NEXT_CLOUDFLARE
2928 ? {
3029 loader : 'custom' ,
3130 loaderFile : './cloudflare-image-loader.ts' ,
@@ -125,12 +124,7 @@ const nextConfig = {
125124 } ,
126125 // If we're building for the Cloudflare deployment we want to set
127126 // an appropriate deploymentId (needed for skew protection)
128- // TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being
129- // defined in the worker building script, ideally the open-next
130- // adapter should set it itself when it invokes the Next.js build
131- // process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE`
132- // definition in the package.json script.
133- deploymentId : process . env . OPEN_NEXT_CLOUDFLARE
127+ deploymentId : OPEN_NEXT_CLOUDFLARE
134128 ? ( await import ( '@opennextjs/cloudflare' ) ) . getDeploymentId ( )
135129 : undefined ,
136130} ;
0 commit comments