From e3db7712657232fbb9ea2499a2c6f277d2bb96a3 Mon Sep 17 00:00:00 2001 From: patak Date: Tue, 23 May 2023 08:16:26 +0200 Subject: [PATCH] fix: optimizeDeps during build and external ids (#13274) --- packages/vite/src/node/plugins/optimizedDeps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/node/plugins/optimizedDeps.ts b/packages/vite/src/node/plugins/optimizedDeps.ts index f832e5da395c6c..7bb1e040517320 100644 --- a/packages/vite/src/node/plugins/optimizedDeps.ts +++ b/packages/vite/src/node/plugins/optimizedDeps.ts @@ -106,12 +106,12 @@ export function optimizedDepsBuildPlugin(config: ResolvedConfig): Plugin { ...options, skipSelf: true, }) - if (resolved) { + if (resolved && !resolved.external) { depsOptimizer.delayDepsOptimizerUntil(resolved.id, async () => { await this.load(resolved) }) - return resolved } + return resolved } },