From a73490c7c84b9247f3cb9c3a2c96696d1f0a8539 Mon Sep 17 00:00:00 2001 From: lilnasy <69170106+lilnasy@users.noreply.github.com> Date: Wed, 3 May 2023 23:42:57 +0530 Subject: [PATCH] refactor(css build plugin): remove use of spread operator --- packages/astro/src/core/build/internal.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index 4bd3128ffe9b..eff3f5becff3 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -269,9 +269,11 @@ export function mergeInlineCss( const currentIsInline = current?.type === 'inline'; if (lastWasInline && currentIsInline) { const merged = { type: 'inline' as const, content: lastAdded.content + current.content }; - return [...acc.slice(0, acc.length - 1), merged]; + acc[acc.length - 1] = merged; + return acc; } - return [...acc, current]; + acc.push(current) + return acc; } export function isHoistedScript(internals: BuildInternals, id: string): boolean {