diff --git a/packages/nuxt/src/core/utils/index.ts b/packages/nuxt/src/core/utils/index.ts index 9ce54f0f06..8321e2fd01 100644 --- a/packages/nuxt/src/core/utils/index.ts +++ b/packages/nuxt/src/core/utils/index.ts @@ -2,6 +2,9 @@ export * from './names' export * from './plugins' export function uniqueBy (arr: T[], key: K) { + if (arr.length < 2) { + return arr + } const res: T[] = [] const seen = new Set() for (const item of arr) {