Skip to content

Commit 5bbe6f7

Browse files
move cloudflare constant in next.constants.cloudflare.mjs
1 parent 22df719 commit 5bbe6f7

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

apps/site/next.config.mjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
'use strict';
22
import createNextIntlPlugin from 'next-intl/plugin';
33

4-
import {
5-
BASE_PATH,
6-
ENABLE_STATIC_EXPORT,
7-
OPEN_NEXT_CLOUDFLARE,
8-
} from './next.constants.mjs';
4+
import { OPEN_NEXT_CLOUDFLARE } from './next.constants.cloudflare.mjs';
5+
import { BASE_PATH, ENABLE_STATIC_EXPORT } from './next.constants.mjs';
96
import { getImagesConfig } from './next.image.config.mjs';
107
import { redirects, rewrites } from './next.rewrites.mjs';
118

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
/**
4+
* Whether the build process is targeting the Cloudflare open-next build or not.
5+
*
6+
* TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being
7+
* defined in the worker building script, ideally the open-next
8+
* adapter should set it itself when it invokes the Next.js build
9+
* process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE`
10+
* definition in the package.json script.
11+
*/
12+
export const OPEN_NEXT_CLOUDFLARE = process.env.OPEN_NEXT_CLOUDFLARE;

apps/site/next.constants.mjs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,3 @@ export const EOL_VERSION_IDENTIFIER = 'End-of-life';
213213
*/
214214
export const VULNERABILITIES_URL =
215215
'https://raw.githubusercontent.com/nodejs/security-wg/main/vuln/core/index.json';
216-
217-
/**
218-
* Whether the build process is targeting the Cloudflare open-next build or not.
219-
*
220-
* TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being
221-
* defined in the worker building script, ideally the open-next
222-
* adapter should set it itself when it invokes the Next.js build
223-
* process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE`
224-
* definition in the package.json script.
225-
*/
226-
export const OPEN_NEXT_CLOUDFLARE = process.env.OPEN_NEXT_CLOUDFLARE;

apps/site/next.image.config.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import {
2-
ENABLE_STATIC_EXPORT,
3-
OPEN_NEXT_CLOUDFLARE,
4-
} from './next.constants.mjs';
1+
import { OPEN_NEXT_CLOUDFLARE } from './next.constants.cloudflare.mjs';
2+
import { ENABLE_STATIC_EXPORT } from './next.constants.mjs';
53

64
const remotePatterns = [
75
'https://avatars.githubusercontent.com/**',

0 commit comments

Comments
 (0)