From 894cd560c3065a7a8de62cd4280ef3d157ebc3a9 Mon Sep 17 00:00:00 2001 From: patak Date: Tue, 21 Mar 2023 17:07:10 +0100 Subject: [PATCH] fix: esbuild complains with extra fields --- packages/vite/src/node/plugins/esbuild.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/vite/src/node/plugins/esbuild.ts b/packages/vite/src/node/plugins/esbuild.ts index 2ce1c1e83f1fd7..55b079577ce679 100644 --- a/packages/vite/src/node/plugins/esbuild.ts +++ b/packages/vite/src/node/plugins/esbuild.ts @@ -161,6 +161,12 @@ export async function transformWithEsbuild( tsconfigRaw, } as ESBuildOptions + // Some projects in the ecosystem are calling this function with an ESBuildOptions + // object and esbuild throws an error for extra fields + delete resolvedOptions.include + delete resolvedOptions.exclude + delete resolvedOptions.jsxInject + try { const result = await transform(code, resolvedOptions) let map: SourceMap