@@ -8,15 +8,15 @@ export type SentryWebpackPlugin = WebpackPluginInstance & { options: SentryWebpa
8
8
* Overall Nextjs config
9
9
*/
10
10
11
- export type ExportedNextConfig = NextConfigObject | NextConfigFunction ;
11
+ export type ExportedNextConfig = Partial < NextConfigObject > | NextConfigFunction ;
12
12
13
13
export type NextConfigObject = {
14
14
// custom webpack options
15
- webpack ? : WebpackConfigFunction ;
15
+ webpack : WebpackConfigFunction ;
16
16
// whether to build serverless functions for all pages, not just API routes
17
- target ? : 'server' | 'experimental-serverless-trace' ;
17
+ target : 'server' | 'experimental-serverless-trace' ;
18
18
// the output directory for the built app (defaults to ".next")
19
- distDir ? : string ;
19
+ distDir : string ;
20
20
sentry ?: {
21
21
disableServerWebpackPlugin ?: boolean ;
22
22
disableClientWebpackPlugin ?: boolean ;
@@ -26,10 +26,7 @@ export type NextConfigObject = {
26
26
[ key : string ] : unknown ;
27
27
} ;
28
28
29
- export type NextConfigFunction = (
30
- phase : string ,
31
- defaults : { defaultConfig : { [ key : string ] : unknown } } ,
32
- ) => NextConfigObject ;
29
+ export type NextConfigFunction = ( phase : string , defaults : { defaultConfig : NextConfigObject } ) => NextConfigObject ;
33
30
34
31
/**
35
32
* Webpack config
@@ -59,7 +56,7 @@ export type BuildContext = {
59
56
isServer : boolean ;
60
57
buildId : string ;
61
58
dir : string ;
62
- config : Partial < NextConfigObject > ;
59
+ config : NextConfigObject ;
63
60
webpack : { version : string } ;
64
61
} ;
65
62
0 commit comments