Skip to content

Commit 30de0b9

Browse files
committed
fix(schematics): do not use npm-run-all when parallel is set ot false
1 parent c3ea765 commit 30de0b9

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

packages/schematics/src/command-line/affected.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,39 @@ function printError(command: string, e: any) {
4444

4545
function build(apps: string[], rest: string[]) {
4646
if (apps.length > 0) {
47+
console.log(`Building ${apps.join(', ')}`);
48+
4749
const parallel = yargsParser(rest, {
4850
default: {
49-
parallel: true
51+
parallel: false
5052
},
5153
boolean: ['parallel']
5254
}).parallel;
5355

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+
6780
} else {
6881
console.log('No apps to build');
6982
}

0 commit comments

Comments
 (0)