From 0dd2579c586f19c18ee566d2ff549251fa1d6c45 Mon Sep 17 00:00:00 2001 From: Franco Romano Losada <68303277+fprl@users.noreply.github.com> Date: Tue, 9 Apr 2024 07:04:46 +0000 Subject: [PATCH] f5ba0d5 fix(#5665): rewritten routes get ignored by dynamic and catchAll routes (#6101) https://github.com/BuilderIO/qwik/commit/f31c865516f2fd715664dd9b52d409c3e1fe9744 --- package.json | 2 +- vite/index.cjs | 3 ++- vite/index.mjs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ddbf4c8..ec86acc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@builder.io/qwik-city", "description": "The meta-framework for Qwik.", - "version": "1.5.1-dev20240409010701", + "version": "1.5.1-dev20240409065124", "bugs": "https://github.com/BuilderIO/qwik/issues", "dependencies": { "@mdx-js/mdx": "^3.0.1", diff --git a/vite/index.cjs b/vite/index.cjs index a8f85d8..717d22c 100644 --- a/vite/index.cjs +++ b/vite/index.cjs @@ -24419,7 +24419,8 @@ function rewriteRoutes(ctx, resolved) { } const translatedPath = translatedPathParts.join("/"); const translatedRoute = translatedRouteParts.join("/"); - resolved.routes.push({ + const originalRouteIndex = resolved.routes.indexOf(rewriteRoute); + resolved.routes.splice(originalRouteIndex + 1, 0, { ...rewriteRoute, id: rewriteRoute.id + (idSuffix || rewriteIndex), pathname: pathnamePrefix + translatedPath, diff --git a/vite/index.mjs b/vite/index.mjs index d2ac534..7694a56 100644 --- a/vite/index.mjs +++ b/vite/index.mjs @@ -24409,7 +24409,8 @@ function rewriteRoutes(ctx, resolved) { } const translatedPath = translatedPathParts.join("/"); const translatedRoute = translatedRouteParts.join("/"); - resolved.routes.push({ + const originalRouteIndex = resolved.routes.indexOf(rewriteRoute); + resolved.routes.splice(originalRouteIndex + 1, 0, { ...rewriteRoute, id: rewriteRoute.id + (idSuffix || rewriteIndex), pathname: pathnamePrefix + translatedPath,