@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'
3
3
import type { RemotePattern } from 'next-with-adapters/dist/shared/lib/image-config.js'
4
4
import { makeRe } from 'picomatch'
5
5
6
- import type { NextConfigComplete , OnBuildCompleteContext } from './types.js'
6
+ import type { FrameworksAPIConfig , NextConfigComplete , OnBuildCompleteContext } from './types.js'
7
7
8
8
const NETLIFY_IMAGE_LOADER_FILE = fileURLToPath ( import . meta. resolve ( `./next-image-loader.cjs` ) )
9
9
@@ -20,8 +20,11 @@ function generateRegexFromPattern(pattern: string): string {
20
20
return makeRe ( pattern ) . source
21
21
}
22
22
23
- export function onBuildComplete ( ctx : OnBuildCompleteContext , frameworksAPIConfigArg : any ) {
24
- const frameworksAPIConfig : any = frameworksAPIConfigArg ?? { }
23
+ export function onBuildComplete (
24
+ ctx : OnBuildCompleteContext ,
25
+ frameworksAPIConfigArg : FrameworksAPIConfig ,
26
+ ) {
27
+ const frameworksAPIConfig : FrameworksAPIConfig = frameworksAPIConfigArg ?? { }
25
28
26
29
// when migrating from @netlify /plugin-nextjs@4 image redirect to ipx might be cached in the browser
27
30
frameworksAPIConfig . redirects ??= [ ]
@@ -95,7 +98,7 @@ export function onBuildComplete(ctx: OnBuildCompleteContext, frameworksAPIConfig
95
98
96
99
if ( remoteImageSources . length !== 0 ) {
97
100
// https://docs.netlify.com/build/frameworks/frameworks-api/#images
98
- frameworksAPIConfig . images ??= { }
101
+ frameworksAPIConfig . images ??= { remote_images : [ ] }
99
102
frameworksAPIConfig . images . remote_images = remoteImageSources
100
103
}
101
104
}
0 commit comments