diff --git a/src/lib/steps/setupRedirects.js b/src/lib/steps/setupRedirects.js index 54ac3e5ed6..6f03a7d4e8 100644 --- a/src/lib/steps/setupRedirects.js +++ b/src/lib/steps/setupRedirects.js @@ -74,13 +74,13 @@ const setupRedirects = async (publishPath) => { const basePathSortFunc = (a, b) => { if (a.target.includes(basePath) && b.target.includes(basePath)) { return 0 - } if (a.target.includes(basePath) && !b.target.includes(basePath)) { + } + if (a.target.includes(basePath) && !b.target.includes(basePath)) { return -1 - // } else if (!a.target.includes(basePath) && b.target.includes(basePath)) { - // return 0 - } - return 1 - + // } else if (!a.target.includes(basePath) && b.target.includes(basePath)) { + // return 0 + } + return 1 } const allRedirects = hasBasePath ? [...sortedStaticRedirects.sort(basePathSortFunc), ...sortedDynamicRedirects.sort(basePathSortFunc)]