@@ -8,15 +8,15 @@ export type SentryWebpackPlugin = WebpackPluginInstance & { options: SentryWebpa
88 * Overall Nextjs config
99 */
1010
11- export type ExportedNextConfig = NextConfigObject | NextConfigFunction ;
11+ export type ExportedNextConfig = Partial < NextConfigObject > | NextConfigFunction ;
1212
1313export type NextConfigObject = {
1414 // custom webpack options
15- webpack ? : WebpackConfigFunction ;
15+ webpack : WebpackConfigFunction ;
1616 // whether to build serverless functions for all pages, not just API routes
17- target ? : 'server' | 'experimental-serverless-trace' ;
17+ target : 'server' | 'experimental-serverless-trace' ;
1818 // the output directory for the built app (defaults to ".next")
19- distDir ? : string ;
19+ distDir : string ;
2020 sentry ?: {
2121 disableServerWebpackPlugin ?: boolean ;
2222 disableClientWebpackPlugin ?: boolean ;
@@ -26,10 +26,7 @@ export type NextConfigObject = {
2626 [ key : string ] : unknown ;
2727} ;
2828
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 ;
3330
3431/**
3532 * Webpack config
@@ -59,7 +56,7 @@ export type BuildContext = {
5956 isServer : boolean ;
6057 buildId : string ;
6158 dir : string ;
62- config : Partial < NextConfigObject > ;
59+ config : NextConfigObject ;
6360 webpack : { version : string } ;
6461} ;
6562
0 commit comments