diff options
-rw-r--r-- | packages/astro/src/core/routing/manifest/create.ts | 8 | ||||
-rw-r--r-- | packages/astro/test/units/routing/manifest.nodetest.js | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index a3170a2ce..93b3770b1 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -761,10 +761,10 @@ export function createRouteManifest( if (defaultLocaleRoutes) { // The index for the default locale will be either already at the root path // or at the root of the locale. - const indexDefaultRoute = defaultLocaleRoutes - .find(({route}) => route === '/') - ?? defaultLocaleRoutes.find(({route}) => route === `/${i18n.defaultLocale}`); - + const indexDefaultRoute = + defaultLocaleRoutes.find(({ route }) => route === '/') ?? + defaultLocaleRoutes.find(({ route }) => route === `/${i18n.defaultLocale}`); + if (indexDefaultRoute) { // we found the index of the default locale, now we create a root index that will redirect to the index of the default locale const pathname = '/'; diff --git a/packages/astro/test/units/routing/manifest.nodetest.js b/packages/astro/test/units/routing/manifest.nodetest.js index 110582bfb..5e90c6c79 100644 --- a/packages/astro/test/units/routing/manifest.nodetest.js +++ b/packages/astro/test/units/routing/manifest.nodetest.js @@ -148,7 +148,7 @@ describe('routing - createRouteManifest', () => { ['/[dynamic]', '/[...rest]'], ]); }); - + it('route sorting with multi-layer index page conflict', async () => { // Reproducing regression from https://github.com/withastro/astro/issues/10071 const fs = createFs( @@ -190,7 +190,7 @@ describe('routing - createRouteManifest', () => { ['/a/3', '/'], ['/test', '/'], ['/modules', '/'], - + // Alphabetical order ['/modules', '/test'], ]); |