Skip to content

Commit e3e7f1d

Browse files
committed
log when a route has been excluded
1 parent 5013714 commit e3e7f1d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/nextjs/src/config/webpack.ts

+10
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,16 @@ async function addSentryToEntryProperty(
275275
for (const entryPointName in newEntryProperty) {
276276
if (shouldAddSentryToEntryPoint(entryPointName, isServer, userSentryOptions.excludeServerRoutes)) {
277277
addFilesToExistingEntryPoint(newEntryProperty, entryPointName, filesToInject);
278+
} else {
279+
if (
280+
isServer &&
281+
// If the user has asked to exclude pages, confirm for them that it's worked
282+
userSentryOptions.excludeServerRoutes &&
283+
// We always skip these, so it's not worth telling the user that we've done so
284+
!['pages/_app', 'pages/_document'].includes(entryPointName)
285+
) {
286+
__DEBUG_BUILD__ && logger.log(`Skipping Sentry injection for ${entryPointName.replace(/^pages/, '')}`);
287+
}
278288
}
279289
}
280290

0 commit comments

Comments
 (0)