@@ -223,7 +223,13 @@ export async function build({
223
223
meta = { } as BuildParamsMeta ,
224
224
} : BuildParamsType ) : Promise < {
225
225
routes : Route [ ] ;
226
- images ?: { domains : string [ ] ; sizes : number [ ] } ;
226
+ images ?: {
227
+ domains : string [ ] ;
228
+ sizes : number [ ] ;
229
+ formats ?: string [ ] | undefined ;
230
+ dangerouslyAllowSVG ?: boolean | undefined ;
231
+ contentSecurityPolicy ?: string | undefined ;
232
+ } ;
227
233
output : Files ;
228
234
wildcard ?: Array < {
229
235
domain : string ;
@@ -660,11 +666,31 @@ export async function build({
660
666
}
661
667
if ( ! Array . isArray ( images . sizes ) ) {
662
668
throw new NowBuildError ( {
663
- code : 'NEXT_IMAGES_DOMAINS ' ,
669
+ code : 'NEXT_IMAGES_SIZES ' ,
664
670
message :
665
671
'image-manifest.json "images.sizes" must be an array. Contact support if this continues to happen.' ,
666
672
} ) ;
667
673
}
674
+ if (
675
+ typeof images . dangerouslyAllowSVG !== 'undefined' &&
676
+ typeof images . dangerouslyAllowSVG !== 'boolean'
677
+ ) {
678
+ throw new NowBuildError ( {
679
+ code : 'NEXT_IMAGES_DANGEROUSLYALLOWSVG' ,
680
+ message :
681
+ 'image-manifest.json "images.dangerouslyAllowSVG" must be an boolean. Contact support if this continues to happen.' ,
682
+ } ) ;
683
+ }
684
+ if (
685
+ typeof images . contentSecurityPolicy !== 'undefined' &&
686
+ typeof images . contentSecurityPolicy !== 'string'
687
+ ) {
688
+ throw new NowBuildError ( {
689
+ code : 'NEXT_IMAGES_CONTENTSECURITYPOLICY' ,
690
+ message :
691
+ 'image-manifest.json "images.contentSecurityPolicy" must be an string. Contact support if this continues to happen.' ,
692
+ } ) ;
693
+ }
668
694
break ;
669
695
}
670
696
default : {
@@ -2129,6 +2155,9 @@ export async function build({
2129
2155
? {
2130
2156
domains : imagesManifest . images . domains ,
2131
2157
sizes : imagesManifest . images . sizes ,
2158
+ formats : imagesManifest . images . formats ,
2159
+ dangerouslyAllowSVG : imagesManifest . images . dangerouslyAllowSVG ,
2160
+ contentSecurityPolicy : imagesManifest . images . contentSecurityPolicy ,
2132
2161
}
2133
2162
: undefined ,
2134
2163
/*
0 commit comments