chore: Moved legacy rewrites from afterFiles to beforeFiles (#15164)

This commit is contained in:
Omar López
2024-05-22 12:14:08 -07:00
committed by GitHub
parent 04bf23ed69
commit 26bd02bd94
+23 -23
View File
@@ -264,6 +264,29 @@ const nextConfig = {
},
async rewrites() {
const beforeFiles = [
{
source: "/forms/:formQuery*",
destination: "/apps/routing-forms/routing-link/:formQuery*",
},
{
source: "/router",
destination: "/apps/routing-forms/router",
},
{
source: "/success/:path*",
has: [
{
type: "query",
key: "uid",
value: "(?<uid>.*)",
},
],
destination: "/booking/:uid/:path*",
},
{
source: "/cancel/:path*",
destination: "/booking/:path*",
},
{
/**
* Needed due to the introduction of dotted usernames
@@ -327,29 +350,6 @@ const nextConfig = {
source: "/:user/avatar.png",
destination: "/api/user/avatar?username=:user",
},
{
source: "/forms/:formQuery*",
destination: "/apps/routing-forms/routing-link/:formQuery*",
},
{
source: "/router",
destination: "/apps/routing-forms/router",
},
{
source: "/success/:path*",
has: [
{
type: "query",
key: "uid",
value: "(?<uid>.*)",
},
],
destination: "/booking/:uid/:path*",
},
{
source: "/cancel/:path*",
destination: "/booking/:path*",
},
],
/* TODO: have these files being served from another deployment or CDN {