From d7fd68acc9978d81a66a89f6acfa66871996650d Mon Sep 17 00:00:00 2001 From: userquin Date: Tue, 29 Aug 2023 17:43:21 +0200 Subject: [PATCH] fix(nuxt): sort plugins by order and name --- packages/nuxt/src/core/app.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/app.ts b/packages/nuxt/src/core/app.ts index e0680e271c..b36c421a41 100644 --- a/packages/nuxt/src/core/app.ts +++ b/packages/nuxt/src/core/app.ts @@ -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!) + }) }