Skip to content

Commit

Permalink
Merge pull request #1151 from pawel-twardziak/bugs/capacitor-add-ios-…
Browse files Browse the repository at this point in the history
…fails--no-index.html-in-dist

fix(capacitor): align default web-dir for esbuild executor
  • Loading branch information
edbzn authored Nov 4, 2024
2 parents ec70a9f + 95a7ebc commit 2dfe07b
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,24 @@ export function normalizeOptions(
options: CapacitorConfigurationSchema
): NormalizedSchema {
const appName = options.appName ? options.appName : options.project;
const { root } = 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 =
[
'@angular-devkit/build-angular:application',
'@nx/angular:application',
'@angular-devkit/build-angular:browser-esbuild',
'@nx/angular:browser-esbuild',
].includes(executor) && browser;

const webDir = options.webDir
? options.webDir
: joinPathFragments(`dist/${root}`);
: outputPath
? joinPathFragments(`${outputPath}${esbuildBrowser ? '/browser' : ''}`)
: joinPathFragments('dist', root);

return {
...options,
Expand Down

0 comments on commit 2dfe07b

Please sign in to comment.