File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,15 @@ export default [
14
14
) ,
15
15
...makeNPMConfigVariants (
16
16
makeBaseNPMConfig ( {
17
- entrypoints : [ 'src/config/templates/prefixLoaderTemplate.ts' ] ,
17
+ entrypoints : [
18
+ 'src/config/templates/prefixLoaderTemplate.ts' ,
19
+ 'src/config/templates/dataFetchersLoaderTemplate.ts' ,
20
+ ] ,
18
21
19
22
packageSpecificConfig : {
20
23
output : {
21
- // preserve the original file structure (i.e., so that everything is still relative to `src`)
24
+ // Preserve the original file structure (i.e., so that everything is still relative to `src`). (Not entirely
25
+ // clear why this is necessary here and not for other entrypoints in this file.)
22
26
entryFileNames : 'config/templates/[name].js' ,
23
27
24
28
// this is going to be add-on code, so it doesn't need the trappings of a full module (and in fact actively
Original file line number Diff line number Diff line change
1
+ import type {
2
+ GetServerSideProps as GetServerSidePropsFunction ,
3
+ GetStaticPaths as GetStaticPathsFunction ,
4
+ GetStaticProps as GetStaticPropsFunction ,
5
+ } from 'next' ;
6
+
7
+ import type { withSentryGSPaths , withSentryGSProps , withSentryGSSP } from '../wrappers' ;
8
+
9
+ // TODO: Somehow the types for the imported SDK aren't recognized when it's imported using `require`, so for the moment,
10
+ // we're faking it
11
+ type SentrySDK = {
12
+ withSentryGSSP : typeof withSentryGSSP ;
13
+ withSentryGSProps : typeof withSentryGSProps ;
14
+ withSentryGSPaths : typeof withSentryGSPaths ;
15
+ } ;
16
+
17
+ declare const _getServerSideProps : GetServerSidePropsFunction ;
18
+ declare const _getStaticProps : GetStaticPropsFunction ;
19
+ declare const _getStaticPaths : GetStaticPathsFunction ;
20
+
21
+ // TODO: This is a require rather than an imoprt because for some reason, using `import` makes rollup silently refuse to
22
+ // output a built version of this file.
23
+ // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
24
+ const ServerSideSentryNextjsSDK = require ( '@sentry/nextjs' ) ;
25
+
26
+ export const getServerSideProps = ( ServerSideSentryNextjsSDK as SentrySDK ) . withSentryGSSP ( _getServerSideProps ) ;
27
+ export const getStaticProps = ( ServerSideSentryNextjsSDK as SentrySDK ) . withSentryGSProps ( _getStaticProps ) ;
28
+ export const getStaticPaths = ( ServerSideSentryNextjsSDK as SentrySDK ) . withSentryGSPaths ( _getStaticPaths ) ;
You can’t perform that action at this time.
0 commit comments