@@ -5,7 +5,6 @@ import * as path from 'path';
5
5
import * as ts from 'typescript' ;
6
6
7
7
const ContextElementDependency = require ( 'webpack/lib/dependencies/ContextElementDependency' ) ;
8
- const treeKill = require ( 'tree-kill' ) ;
9
8
10
9
import { WebpackResourceLoader } from './resource_loader' ;
11
10
import { WebpackCompilerHost } from './compiler_host' ;
@@ -507,29 +506,11 @@ export class AngularCompilerPlugin implements Tapable {
507
506
forkOptions ) ;
508
507
509
508
// Handle child process exit.
510
- const handleChildProcessExit = ( ) => {
511
- this . _killForkedTypeChecker ( ) ;
509
+ this . _typeCheckerProcess . on ( 'exit' , ( ) => {
512
510
const msg = 'AngularCompilerPlugin: Forked Type Checker exited unexpectedly. ' +
513
511
'Falling back to type checking on main thread.' ;
514
512
this . _warnings . push ( msg ) ;
515
- } ;
516
- this . _typeCheckerProcess . once ( 'exit' , handleChildProcessExit ) ;
517
- this . _typeCheckerProcess . once ( 'SIGINT' , handleChildProcessExit ) ;
518
- this . _typeCheckerProcess . once ( 'uncaughtException' , handleChildProcessExit ) ;
519
-
520
- // Handle parent process exit.
521
- const handleParentProcessExit = ( ) => this . _killForkedTypeChecker ( ) ;
522
- process . once ( 'exit' , handleParentProcessExit ) ;
523
- process . once ( 'SIGINT' , handleParentProcessExit ) ;
524
- process . once ( 'uncaughtException' , handleParentProcessExit ) ;
525
- }
526
-
527
- private _killForkedTypeChecker ( ) {
528
- if ( this . _typeCheckerProcess && this . _typeCheckerProcess . pid ) {
529
- treeKill ( this . _typeCheckerProcess . pid , 'SIGTERM' ) ;
530
- this . _typeCheckerProcess = undefined ;
531
- this . _forkTypeChecker = false ;
532
- }
513
+ } ) ;
533
514
}
534
515
535
516
private _updateForkedTypeChecker ( rootNames : string [ ] , changedCompilationFiles : string [ ] ) {
@@ -618,7 +599,6 @@ export class AngularCompilerPlugin implements Tapable {
618
599
}
619
600
callback ( ) ;
620
601
} ) ;
621
- compiler . plugin ( 'watch-close' , ( ) => this . _killForkedTypeChecker ( ) ) ;
622
602
623
603
// Remake the plugin on each compilation.
624
604
compiler . plugin ( 'make' , ( compilation : any , cb : any ) => this . _make ( compilation , cb ) ) ;
0 commit comments