@@ -3,6 +3,7 @@ import { dirname } from 'node:path'
3
3
4
4
import type { NextAdapter } from 'next-with-adapters'
5
5
6
+ import { onBuildComplete as onBuildCompleteForHeaders } from './header.js'
6
7
import {
7
8
modifyConfig as modifyConfigForImageCDN ,
8
9
onBuildComplete as onBuildCompleteForImageCDN ,
@@ -23,12 +24,13 @@ const adapter: NextAdapter = {
23
24
24
25
return config
25
26
} ,
26
- async onBuildComplete ( ctx ) {
27
+ async onBuildComplete ( nextAdapterContext ) {
27
28
console . log ( 'onBuildComplete hook called' )
28
29
29
30
let frameworksAPIConfig : FrameworksAPIConfig = null
30
31
31
- frameworksAPIConfig = onBuildCompleteForImageCDN ( ctx , frameworksAPIConfig )
32
+ frameworksAPIConfig = onBuildCompleteForImageCDN ( nextAdapterContext , frameworksAPIConfig )
33
+ frameworksAPIConfig = onBuildCompleteForHeaders ( nextAdapterContext , frameworksAPIConfig )
32
34
33
35
if ( frameworksAPIConfig ) {
34
36
// write out config if there is any
@@ -40,7 +42,7 @@ const adapter: NextAdapter = {
40
42
}
41
43
42
44
// for dev/debugging purposes only
43
- await writeFile ( './onBuildComplete.json' , JSON . stringify ( ctx , null , 2 ) )
45
+ await writeFile ( './onBuildComplete.json' , JSON . stringify ( nextAdapterContext , null , 2 ) )
44
46
debugger
45
47
} ,
46
48
}
0 commit comments