Skip to content

Commit

Permalink
log when a route has been excluded
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Nov 15, 2022
1 parent ebcae25 commit c7b7c30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ async function addSentryToEntryProperty(
for (const entryPointName in newEntryProperty) {
if (shouldAddSentryToEntryPoint(entryPointName, isServer, userSentryOptions.excludeServerRoutes)) {
addFilesToExistingEntryPoint(newEntryProperty, entryPointName, filesToInject);
} else {
if (
isServer &&
// If the user has asked to exclude pages, confirm for them that it's worked
userSentryOptions.excludeServerRoutes &&
// We always skip these, so it's not worth telling the user that we've done so
!['pages/_app', 'pages/_document'].includes(entryPointName)
) {
__DEBUG_BUILD__ && logger.log(`Skipping Sentry injection for ${entryPointName.replace(/^pages/, '')}`);
}
}
}

Expand Down

0 comments on commit c7b7c30

Please sign in to comment.