File tree 1 file changed +27
-14
lines changed
packages/schematics/src/command-line
1 file changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -44,26 +44,39 @@ function printError(command: string, e: any) {
44
44
45
45
function build ( apps : string [ ] , rest : string [ ] ) {
46
46
if ( apps . length > 0 ) {
47
+ console . log ( `Building ${ apps . join ( ', ' ) } ` ) ;
48
+
47
49
const parallel = yargsParser ( rest , {
48
50
default : {
49
- parallel : true
51
+ parallel : false
50
52
} ,
51
53
boolean : [ 'parallel' ]
52
54
} ) . parallel ;
53
55
54
- console . log ( `Building ${ apps . join ( ', ' ) } ` ) ;
55
- const buildCommands = rest . filter ( a => ! a . startsWith ( '--parallel' ) ) ;
56
- runAll (
57
- apps . map ( app => `ng build -- ${ buildCommands . join ( ' ' ) } -a=${ app } ` ) ,
58
- {
59
- parallel,
60
- stdin : process . stdin ,
61
- stdout : process . stdout ,
62
- stderr : process . stderr
63
- }
64
- )
65
- . then ( ( ) => console . log ( 'Build succeeded.' ) )
66
- . catch ( err => console . error ( 'Build failed.' ) ) ;
56
+ const buildCommands = rest . filter ( a => ! a . startsWith ( '--parallel' ) && ! a . startsWith ( '--no-parallel' ) ) ;
57
+ if ( parallel ) {
58
+ runAll (
59
+ apps . map ( app => `ng build -- ${ buildCommands . join ( ' ' ) } -a=${ app } ` ) ,
60
+ {
61
+ parallel,
62
+ stdin : process . stdin ,
63
+ stdout : process . stdout ,
64
+ stderr : process . stderr
65
+ }
66
+ )
67
+ . then ( ( ) => console . log ( 'Build succeeded.' ) )
68
+ . catch ( err => console . error ( 'Build failed.' ) ) ;
69
+ } else {
70
+ apps . forEach ( app => {
71
+ execSync (
72
+ `node ${ ngPath ( ) } build ${ buildCommands . join ( ' ' ) } -a=${ app } ` ,
73
+ {
74
+ stdio : [ 0 , 1 , 2 ]
75
+ }
76
+ ) ;
77
+ } ) ;
78
+ }
79
+
67
80
} else {
68
81
console . log ( 'No apps to build' ) ;
69
82
}
You can’t perform that action at this time.
0 commit comments