File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable max-lines */
22import { getSentryRelease } from '@sentry/node' ;
3- import { dropUndefinedKeys , logger } from '@sentry/utils' ;
3+ import { dropUndefinedKeys , escapeStringForRegex , logger } from '@sentry/utils' ;
44import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin' ;
55import * as fs from 'fs' ;
66import * as path from 'path' ;
@@ -53,6 +53,8 @@ export function constructWebpackConfigFunction(
5353 newConfig = userNextConfig . webpack ( newConfig , buildContext ) ;
5454 }
5555
56+ const pageRegex = new RegExp ( `${ escapeStringForRegex ( projectDir ) } (/src)?/pages(/.+)\\.(jsx?|tsx?)` ) ;
57+
5658 if ( isServer ) {
5759 newConfig . module = {
5860 ...newConfig . module ,
@@ -72,6 +74,15 @@ export function constructWebpackConfigFunction(
7274 } ,
7375 ] ,
7476 } ,
77+ {
78+ test : pageRegex ,
79+ use : [
80+ {
81+ loader : path . resolve ( __dirname , 'loaders/dataFetchersLoader.js' ) ,
82+ options : { projectDir } ,
83+ } ,
84+ ] ,
85+ } ,
7586 ] ,
7687 } ;
7788 }
You can’t perform that action at this time.
0 commit comments