Skip to content

Commit

Permalink
ng-deploy may not have configurations configured... (#6584)
Browse files Browse the repository at this point in the history
* Grab the raw options, if a configuration isn't present
* Accept serveTarget from ng-deploy, setting this by default in angularfire@17
  • Loading branch information
jamesdaniels committed Dec 7, 2023
1 parent 528d573 commit 2ccd9d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed an issue preventing Angular apps using ng-deploy from being emulated or deployed. (#6584)
8 changes: 7 additions & 1 deletion src/frameworks/angular/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ export async function getContext(dir: string, targetOrConfiguration?: string) {
}

if (deployTarget) {
const options = await architectHost.getOptionsForTarget(deployTarget);
const options = await architectHost
.getOptionsForTarget(deployTarget)
.catch(() => workspaceProject.targets.get(deployTarget!.target)?.options);
if (!options) throw new FirebaseError("Unable to get options for ng-deploy.");
if (options.buildTarget) {
assertIsString(options.buildTarget);
Expand All @@ -238,6 +240,10 @@ export async function getContext(dir: string, targetOrConfiguration?: string) {
assertIsString(options.serverTarget);
serverTarget = targetFromTargetString(options.serverTarget);
}
if (options.serveTarget) {
assertIsString(options.serveTarget);
serveTarget = targetFromTargetString(options.serveTarget);
}
if (options.serveOptimizedImages) {
serveOptimizedImages = true;
}
Expand Down

0 comments on commit 2ccd9d9

Please sign in to comment.