Skip to content

Commit

Permalink
feat(build): allow using regex in rewrites
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Jun 14, 2023
1 parent b9eafac commit f831767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node/plugins/rewritesPlugin.ts
Expand Up @@ -8,7 +8,7 @@ export function resolveRewrites(
) {
const rewriteRules = Object.entries(userRewrites || {}).map(([from, to]) => ({
toPath: compile(to),
matchUrl: match(from)
matchUrl: match(from.startsWith('^') ? new RegExp(from) : from)
}))

const pageToRewrite: Record<string, string> = {}
Expand Down

0 comments on commit f831767

Please sign in to comment.