From 069bd6c435ce56c82f8f06d46edaf1de82127915 Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 21 Jul 2024 08:37:09 -0500 Subject: [PATCH] fix: Externalize app config during dependency optimization (#833) --- .../src/core/builders/vite/plugins/resolveAppConfig.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/wxt/src/core/builders/vite/plugins/resolveAppConfig.ts b/packages/wxt/src/core/builders/vite/plugins/resolveAppConfig.ts index d64048814..00180737f 100644 --- a/packages/wxt/src/core/builders/vite/plugins/resolveAppConfig.ts +++ b/packages/wxt/src/core/builders/vite/plugins/resolveAppConfig.ts @@ -13,6 +13,15 @@ export function resolveAppConfig(config: ResolvedConfig): vite.Plugin { return { name: 'wxt:resolve-app-config', + config() { + return { + optimizeDeps: { + // Prevent ESBuild from attempting to resolve the virtual module + // while optimizing WXT. + exclude: [virtualModuleId], + }, + }; + }, async resolveId(id) { if (id !== virtualModuleId) return;