mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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(',')}}`)
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user