Skip to content

Commit f831767

Browse files
committed
feat(build): allow using regex in rewrites
1 parent b9eafac commit f831767

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node/plugins/rewritesPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function resolveRewrites(
88
) {
99
const rewriteRules = Object.entries(userRewrites || {}).map(([from, to]) => ({
1010
toPath: compile(to),
11-
matchUrl: match(from)
11+
matchUrl: match(from.startsWith('^') ? new RegExp(from) : from)
1212
}))
1313

1414
const pageToRewrite: Record<string, string> = {}

0 commit comments

Comments
 (0)