From 9101fef33f6eb19647be4183dcda0baa5291c9ba Mon Sep 17 00:00:00 2001 From: 1natsu <1natsu172@users.noreply.github.com> Date: Sat, 31 Aug 2024 12:21:45 +0900 Subject: [PATCH] fix: fix duplicate publicAssets of BuildOutput --- packages/wxt/src/core/utils/building/rebuild.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/wxt/src/core/utils/building/rebuild.ts b/packages/wxt/src/core/utils/building/rebuild.ts index fa6cfbd6b..711dd7d77 100644 --- a/packages/wxt/src/core/utils/building/rebuild.ts +++ b/packages/wxt/src/core/utils/building/rebuild.ts @@ -47,14 +47,16 @@ export async function rebuild( const newOutput = await buildEntrypoints(entrypointGroups, spinner); const mergedOutput: Omit = { steps: [...existingOutput.steps, ...newOutput.steps], - publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets], + // Do not merge existing because all publicAssets copied everytime + publicAssets: newOutput.publicAssets, }; const { manifest: newManifest, warnings: manifestWarnings } = await generateManifest(allEntrypoints, mergedOutput); + const finalOutput: BuildOutput = { manifest: newManifest, - ...newOutput, + ...mergedOutput, }; // Write manifest @@ -64,14 +66,7 @@ export async function rebuild( spinner.clear().stop(); return { - output: { - manifest: newManifest, - steps: [...existingOutput.steps, ...finalOutput.steps], - publicAssets: [ - ...existingOutput.publicAssets, - ...finalOutput.publicAssets, - ], - }, + output: finalOutput, manifest: newManifest, warnings: manifestWarnings, };