@@ -6,37 +6,9 @@ import {
66 ENABLE_STATIC_EXPORT ,
77 OPEN_NEXT_CLOUDFLARE ,
88} from './next.constants.mjs' ;
9+ import { getImagesConfig } from './next.image.config.mjs' ;
910import { redirects , rewrites } from './next.rewrites.mjs' ;
1011
11- const getImagesConfig = ( ) => {
12- if ( OPEN_NEXT_CLOUDFLARE ) {
13- // If we're building for the Cloudflare deployment we want to use the custom cloudflare image loader
14- //
15- // Important: The custom loader ignores `remotePatterns` as those are configured as allowed source origins
16- // (https://developers.cloudflare.com/images/transform-images/sources/)
17- // in the Cloudflare dashboard itself instead (to the exact same values present in `remotePatterns` below).
18- //
19- return {
20- loader : 'custom' ,
21- loaderFile : './cloudflare/image-loader.ts' ,
22- } ;
23- }
24-
25- return {
26- // We disable image optimisation during static export builds
27- unoptimized : ENABLE_STATIC_EXPORT ,
28- // We add it to the remote pattern for the static images we use from multiple sources
29- // to be marked as safe sources (these come from Markdown files)
30- remotePatterns : [
31- new URL ( 'https://avatars.githubusercontent.com/**' ) ,
32- new URL ( 'https://bestpractices.coreinfrastructure.org/**' ) ,
33- new URL ( 'https://raw.githubusercontent.com/nodejs/**' ) ,
34- new URL ( 'https://user-images.githubusercontent.com/**' ) ,
35- new URL ( 'https://website-assets.oramasearch.com/**' ) ,
36- ] ,
37- } ;
38- } ;
39-
4012const getDeploymentId = async ( ) => {
4113 if ( OPEN_NEXT_CLOUDFLARE ) {
4214 // If we're building for the Cloudflare deployment we want to set
0 commit comments