File tree 2 files changed +16
-9
lines changed
packages/nextjs/src/config
2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ export type UserSentryOptions = {
49
49
// uploaded. At the same time, we don't want to widen the scope if we don't have to, because we're guaranteed to end
50
50
// up uploading too many files, which is why this defaults to `false`.
51
51
widenClientFileUpload ?: boolean ;
52
+
53
+ // Automatically wrap `getServerSideProps`, `getStaticProps`, and `getStaticPaths` in order to instrument them for
54
+ // tracing.
55
+ autoWrapDataFetchers ?: boolean ;
52
56
} ;
53
57
54
58
export type NextConfigFunction = ( phase : string , defaults : { defaultConfig : NextConfigObject } ) => NextConfigObject ;
Original file line number Diff line number Diff line change @@ -74,17 +74,20 @@ export function constructWebpackConfigFunction(
74
74
} ,
75
75
] ,
76
76
} ,
77
- {
78
- test : pageRegex ,
79
- use : [
80
- {
81
- loader : path . resolve ( __dirname , 'loaders/dataFetchersLoader.js' ) ,
82
- options : { projectDir } ,
83
- } ,
84
- ] ,
85
- } ,
86
77
] ,
87
78
} ;
79
+
80
+ if ( userSentryOptions . autoWrapDataFetchers ) {
81
+ newConfig . module . rules . push ( {
82
+ test : pageRegex ,
83
+ use : [
84
+ {
85
+ loader : path . resolve ( __dirname , 'loaders/dataFetchersLoader.js' ) ,
86
+ options : { projectDir } ,
87
+ } ,
88
+ ] ,
89
+ } ) ;
90
+ }
88
91
}
89
92
90
93
// The SDK uses syntax (ES6 and ES6+ features like object spread) which isn't supported by older browsers. For users
You can’t perform that action at this time.
0 commit comments