From df7d67d8ae9be07c4a8cfd0bc6249eb8635055b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Twardziak?= Date: Sun, 3 Nov 2024 22:32:43 +0100 Subject: [PATCH] fix(capacitor): align default web-dir for esbuild executor Cover non-angular apps --- .../configuration/lib/normalize-options.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/capacitor/src/generators/configuration/lib/normalize-options.ts b/packages/capacitor/src/generators/configuration/lib/normalize-options.ts index 2bd3cf8c..f9b41dff 100644 --- a/packages/capacitor/src/generators/configuration/lib/normalize-options.ts +++ b/packages/capacitor/src/generators/configuration/lib/normalize-options.ts @@ -11,15 +11,10 @@ export function normalizeOptions( options: CapacitorConfigurationSchema ): NormalizedSchema { const appName = options.appName ? options.appName : options.project; - const { - root, - targets: { - build: { - executor, - options: { outputPath, browser }, - }, - }, - } = readProjectConfiguration(host, options.project); + const { root, targets } = readProjectConfiguration(host, options.project); + const executor = targets?.build?.executor; + const outputPath = targets?.build?.options?.outputPath; + const browser = targets?.build?.options?.browser; const esbuildBrowser = [ @@ -31,7 +26,9 @@ export function normalizeOptions( const webDir = options.webDir ? options.webDir - : joinPathFragments(`${outputPath}${esbuildBrowser ? '/browser' : ''}`); + : outputPath + ? joinPathFragments(`${outputPath}${esbuildBrowser ? '/browser' : ''}`) + : joinPathFragments('dist', root); return { ...options,