fix(nuxt): sort plugins by order and name

This commit is contained in:
userquin 2023-08-29 17:43:21 +02:00
parent d75e906db7
commit d7fd68acc9

View File

@ -187,5 +187,9 @@ export async function annotatePlugins (nuxt: Nuxt, plugins: NuxtPlugin[]) {
} }
} }
return _plugins.sort((a, b) => (a.order ?? orderMap.default) - (b.order ?? orderMap.default)) return _plugins.sort((a, b) => {
const sortMapResult = (a.order ?? orderMap.default) - (b.order ?? orderMap.default)
if (sortMapResult !== 0) { return sortMapResult }
return a.src!.localeCompare(b.src!)
})
} }