Skip to content

Commit f42cfa2

Browse files
committed
trying to avoid duplicated regex
1 parent e6b6b7d commit f42cfa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/targets/browser/blazorSourcePathResolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export class BlazorSourcePathResolver extends BrowserSourcePathResolver {
5555
// Blazor files have a file:/// url. Override the default absolutePathToUrlRegexp which returns an http based regexp
5656
const fileUrl = utils.absolutePathToFileUrl(absolutePath);
5757
const fileRegexp = utils.urlToRegex(fileUrl);
58-
if (this.options.baseUrl)
59-
return `${fileRegexp}|${super.absolutePathToUrlRegexp(absolutePath)}`;
58+
const fileRegexpSuper = super.absolutePathToUrlRegexp(absolutePath);
59+
if (!fileRegexp.includes(fileRegexpSuper)) return `${fileRegexp}|${fileRegexpSuper}`;
6060
return fileRegexp;
6161
}
6262

0 commit comments

Comments
 (0)