File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
packages/angular/cli/models
tests/legacy-cli/e2e/tests/misc Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,13 @@ export abstract class ArchitectCommand<
103103
104104 if ( this . target ) {
105105 // Add options IF there's only one builder of this kind.
106- const projectNames = this . getProjectNamesByTarget ( this . target ) ;
106+ const targetSpec : TargetSpecifier = this . _makeTargetSpecifier ( options ) ;
107+ const projectNames = targetSpec . project
108+ ? [ targetSpec . project ]
109+ : this . getProjectNamesByTarget ( this . target ) ;
110+
107111 const builderConfigurations : BuilderConfiguration [ ] = [ ] ;
108112 for ( const projectName of projectNames ) {
109- const targetSpec : TargetSpecifier = this . _makeTargetSpecifier ( options ) ;
110113 const targetDesc = this . _architect . getBuilderConfiguration ( {
111114 project : projectName ,
112115 target : targetSpec . target ,
@@ -207,7 +210,7 @@ export abstract class ArchitectCommand<
207210 // For multi target commands, we always list all projects that have the target.
208211 return allProjectsForTargetName ;
209212 } else {
210- // For single target commands, we try try the default project project first,
213+ // For single target commands, we try the default project first,
211214 // then the full list if it has a single project, then error out.
212215 const maybeDefaultProject = this . _workspace . getDefaultProjectName ( ) ;
213216 if ( maybeDefaultProject && allProjectsForTargetName . includes ( maybeDefaultProject ) ) {
Original file line number Diff line number Diff line change 1+ import { expectFileToExist } from '../../utils/fs' ;
2+ import { ng } from '../../utils/process' ;
3+ import { updateJsonFile } from '../../utils/project' ;
4+
5+ export default async function ( ) {
6+ await ng ( 'generate' , 'app' , 'secondary-app' ) ;
7+
8+ await updateJsonFile ( 'angular.json' , workspaceJson => {
9+ workspaceJson . defaultProject = undefined ;
10+ } ) ;
11+
12+ await ng ( 'build' , 'secondary-app' ) ;
13+
14+ expectFileToExist ( 'dist/secondary-app/index.html' ) ;
15+ expectFileToExist ( 'dist/secondary-app/main.js' ) ;
16+ }
You can’t perform that action at this time.
0 commit comments