Skip to content

Commit

Permalink
fix(nextjs): Fix matching logic for file convention type for root lev…
Browse files Browse the repository at this point in the history
…el components
  • Loading branch information
lforst committed Oct 21, 2024
1 parent 7e39d04 commit 8b46a6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/nextjs/src/config/loaders/wrappingLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ export default function wrappingLoader(

const componentTypeMatch = path.posix
.normalize(path.relative(appDir, this.resourcePath))
// Replace all backslashes with forward slashes (windows)
.replace(/\\/g, '/')
// Add a slash at the beginning
.replace(/(.*)/, '/$1')
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
.match(new RegExp(`/\\/?([^/]+)\\.(?:${pageExtensionRegex})$`));

Expand Down

0 comments on commit 8b46a6c

Please sign in to comment.