From 4b2012c4897eff6466caac47c235c8d8ac9e1ae8 Mon Sep 17 00:00:00 2001 From: Aaron Klinker Date: Sat, 30 Sep 2023 10:32:39 -0500 Subject: [PATCH] fix: Validate transformed manifest correctly --- src/core/utils/manifest.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/utils/manifest.ts b/src/core/utils/manifest.ts index 8c4d625e..35004098 100644 --- a/src/core/utils/manifest.ts +++ b/src/core/utils/manifest.ts @@ -78,19 +78,19 @@ export async function generateMainfest( if (config.command === 'serve') addDevModeCsp(manifest, config); if (config.command === 'serve') addDevModePermissions(manifest, config); - // TODO: transform manifest here. + const finalManifest = produce(manifest, config.transformManifest); - if (manifest.name == null) + if (finalManifest.name == null) throw Error( "Manifest 'name' is missing. Either:\n1. Set the name in your /package.json\n2. Set a name via the manifest option in your wxt.config.ts", ); - if (manifest.version == null) { + if (finalManifest.version == null) { throw Error( "Manifest 'version' is missing. Either:\n1. Add a version in your /package.json\n2. Pass the version via the manifest option in your wxt.config.ts", ); } - return produce(manifest, config.transformManifest); + return finalManifest; } /**