Skip to content

Commit 33e7156

Browse files
authored
fix: support deployment of an Angular app using legacy browser builder (#7264)
* fix: support deployment of an Angular app using legacy browser builder * feat: add entry to changelog * fix: format * fix: improve the code based on the comments
1 parent 01e61df commit 33e7156

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
- Add support for node22 in function deployments (#7252).
77
- Update to Firebase Data Connect Emulator v1.2.0, which adds support for Postgres 16 and creates the Postgres database specified in dataconnect.yaml or .firebaserc if it does not already exist.
88
- Update to the latest version of the Crashlytics buildtools, v3.
9+
- Support deployment of an Angular app using legacy browser builder (#7264)

src/frameworks/angular/utils.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ export async function getContext(dir: string, targetOrConfiguration?: string) {
355355
const { builder } = definition;
356356
if (target === deployTarget && builder === ExpectedBuilder.DEPLOY) continue;
357357
if (target === buildTarget && builder === ExpectedBuilder.APPLICATION) continue;
358+
if (target === buildTarget && builder === ExpectedBuilder.LEGACY_BROWSER) continue;
358359
if (target === browserTarget && builder === ExpectedBuilder.BROWSER_ESBUILD) continue;
359360
if (target === browserTarget && builder === ExpectedBuilder.LEGACY_BROWSER) continue;
360361
if (target === prerenderTarget && builder === ExpectedBuilder.LEGACY_DEVKIT_PRERENDER)
@@ -412,15 +413,18 @@ export async function getBrowserConfig(sourceDir: string, configuration: string)
412413
if (!buildOrBrowserTarget) {
413414
throw new AssertionError({ message: "expected build or browser target defined" });
414415
}
415-
const { locales, defaultLocale } = await localesForTarget(
416-
sourceDir,
417-
architectHost,
418-
buildOrBrowserTarget,
419-
workspaceProject,
420-
);
421-
const targetOptions = await architectHost.getOptionsForTarget(buildOrBrowserTarget);
416+
const [{ locales, defaultLocale }, targetOptions, builderName] = await Promise.all([
417+
localesForTarget(sourceDir, architectHost, buildOrBrowserTarget, workspaceProject),
418+
architectHost.getOptionsForTarget(buildOrBrowserTarget),
419+
architectHost.getBuilderNameForTarget(buildOrBrowserTarget),
420+
]);
421+
422422
assertIsString(targetOptions?.outputPath);
423-
const outputPath = join(targetOptions.outputPath, buildTarget ? "browser" : "");
423+
424+
const outputPath = join(
425+
targetOptions.outputPath,
426+
buildTarget && builderName === ExpectedBuilder.APPLICATION ? "browser" : "",
427+
);
424428
return { locales, baseHref, outputPath, defaultLocale };
425429
}
426430

0 commit comments

Comments
 (0)