mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
fix(nuxt): sort pages/
files in en-US
locale (#25195)
This commit is contained in:
parent
98fb2be07f
commit
540a5cc78b
@ -51,7 +51,9 @@ export async function resolvePagesRoutes (): Promise<NuxtPage[]> {
|
|||||||
const files = await resolveFiles(dir, `**/*{${nuxt.options.extensions.join(',')}}`)
|
const files = await resolveFiles(dir, `**/*{${nuxt.options.extensions.join(',')}}`)
|
||||||
scannedFiles.push(...files.map(file => ({ relativePath: relative(dir, file), absolutePath: file })))
|
scannedFiles.push(...files.map(file => ({ relativePath: relative(dir, file), absolutePath: file })))
|
||||||
}
|
}
|
||||||
scannedFiles.sort((a, b) => a.relativePath.localeCompare(b.relativePath))
|
|
||||||
|
// sort scanned files using en-US locale to make the result consistent across different system locales
|
||||||
|
scannedFiles.sort((a, b) => a.relativePath.localeCompare(b.relativePath, 'en-US'))
|
||||||
|
|
||||||
const allRoutes = await generateRoutesFromFiles(uniqueBy(scannedFiles, 'relativePath'), nuxt.options.experimental.typedPages, nuxt.vfs)
|
const allRoutes = await generateRoutesFromFiles(uniqueBy(scannedFiles, 'relativePath'), nuxt.options.experimental.typedPages, nuxt.vfs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user