From 36367569f6efa04fb120782ecf5befd86c6a30de Mon Sep 17 00:00:00 2001 From: Schmale97 <71267909+Schmale97@users.noreply.github.com> Date: Tue, 4 Apr 2023 15:43:38 +0100 Subject: [PATCH] fix(esbuild): don't set outfile or outdir if already defined (#14636) --- .../src/executors/esbuild/lib/build-esbuild-options.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts b/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts index beacfa222de8a..3c8563dd10eff 100644 --- a/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts +++ b/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts @@ -51,10 +51,12 @@ export function buildEsbuildOptions( esbuildOptions.define = getClientEnvironment(); } - if (options.singleEntry && options.bundle) { - esbuildOptions.outfile = getOutfile(format, options, context); - } else { - esbuildOptions.outdir = options.outputPath; + if (!esbuildOptions.outfile && !esbuildOptions.outdir) { + if (options.singleEntry && options.bundle && !esbuildOptions.splitting) { + esbuildOptions.outfile = getOutfile(format, options, context); + } else { + esbuildOptions.outdir = options.outputPath; + } } const entryPoints = options.additionalEntryPoints