mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 02:17:15 +00:00
fix(nuxt): sort plugins by order and name
This commit is contained in:
parent
d75e906db7
commit
d7fd68acc9
@ -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!)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user