Skip to content

Commit 66f1898

Browse files
committed
fix(@ngtools/webpack): use process.once instead of process.on
1 parent 057cc97 commit 66f1898

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/@ngtools/webpack/src/angular_compiler_plugin.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ export class AngularCompilerPlugin implements Tapable {
458458
? './type_checker_bootstrap.js'
459459
: './type_checker.js';
460460

461-
462461
let hasMemoryFlag = false;
463462
const memoryFlagRegex = /--max-old-space-size/;
464463
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug(?:-brk|-port)/;
@@ -490,9 +489,9 @@ export class AngularCompilerPlugin implements Tapable {
490489
treeKill(this._typeCheckerProcess.pid, 'SIGTERM');
491490
process.exit();
492491
};
493-
process.on('exit', killTypeCheckerProcess);
494-
process.on('SIGINT', killTypeCheckerProcess);
495-
process.on('uncaughtException', killTypeCheckerProcess);
492+
process.once('exit', killTypeCheckerProcess);
493+
process.once('SIGINT', killTypeCheckerProcess);
494+
process.once('uncaughtException', killTypeCheckerProcess);
496495
}
497496

498497
private _updateForkedTypeChecker(changedTsFiles: string[]) {

0 commit comments

Comments
 (0)