Skip to content

Commit 7ababc2

Browse files
alan-agius4clydin
authored andcommitted
fix(@ngtools/webpack): restore process title after NGCC is executed
More context about this can be found in the following comment: angular#19205 (comment) Closes angular#19205
1 parent 2b96254 commit 7ababc2

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

packages/ngtools/webpack/src/ngcc_processor.ts

+27-22
Original file line numberDiff line numberDiff line change
@@ -117,29 +117,34 @@ export class NgccProcessor {
117117
// that we cannot setup multiple cluster masters with different options.
118118
// - We will not be able to have concurrent builds otherwise Ex: App-Shell,
119119
// as NGCC will create a lock file for both builds and it will cause builds to fails.
120-
const { status, error } = spawnSync(
121-
process.execPath,
122-
[
123-
this.compilerNgcc.ngccMainFilePath,
124-
'--source' /** basePath */,
125-
this._nodeModulesDirectory,
126-
'--properties' /** propertiesToConsider */,
127-
...this.propertiesToConsider,
128-
'--first-only' /** compileAllFormats */,
129-
'--create-ivy-entry-points' /** createNewEntryPointFormats */,
130-
'--async',
131-
'--tsconfig' /** tsConfigPath */,
132-
this.tsConfigPath,
133-
'--use-program-dependencies',
134-
],
135-
{
136-
stdio: ['inherit', process.stderr, process.stderr],
137-
},
138-
);
120+
const originalProcessTitle = process.title;
121+
try {
122+
const { status, error } = spawnSync(
123+
process.execPath,
124+
[
125+
this.compilerNgcc.ngccMainFilePath,
126+
'--source' /** basePath */,
127+
this._nodeModulesDirectory,
128+
'--properties' /** propertiesToConsider */,
129+
...this.propertiesToConsider,
130+
'--first-only' /** compileAllFormats */,
131+
'--create-ivy-entry-points' /** createNewEntryPointFormats */,
132+
'--async',
133+
'--tsconfig' /** tsConfigPath */,
134+
this.tsConfigPath,
135+
'--use-program-dependencies',
136+
],
137+
{
138+
stdio: ['inherit', process.stderr, process.stderr],
139+
},
140+
);
139141

140-
if (status !== 0) {
141-
const errorMessage = error?.message || '';
142-
throw new Error(errorMessage + `NGCC failed${errorMessage ? ', see above' : ''}.`);
142+
if (status !== 0) {
143+
const errorMessage = error?.message || '';
144+
throw new Error(errorMessage + `NGCC failed${errorMessage ? ', see above' : ''}.`);
145+
}
146+
} finally {
147+
process.title = originalProcessTitle;
143148
}
144149

145150
timeEnd(timeLabel);

0 commit comments

Comments
 (0)