File tree Expand file tree Collapse file tree
packages/@ngtools/webpack/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,8 +187,10 @@ export class WebpackCompilerHost implements ts.CompilerHost {
187187 }
188188
189189 invalidate ( fileName : string ) : void {
190- this . _files [ fileName ] = null ;
191- this . _changedFiles [ fileName ] = true ;
190+ if ( fileName in this . _files ) {
191+ this . _files [ fileName ] = null ;
192+ this . _changedFiles [ fileName ] = true ;
193+ }
192194 }
193195
194196 fileExists ( fileName : string ) : boolean {
Original file line number Diff line number Diff line change 1+ import {
2+ killAllProcesses ,
3+ exec ,
4+ waitForAnyProcessOutputToMatch ,
5+ silentExecAndWaitForOutputToMatch
6+ } from '../../utils/process' ;
7+ import { appendToFile } from '../../utils/fs' ;
8+
9+
10+ export default function ( ) {
11+ if ( process . platform . startsWith ( 'win' ) ) {
12+ return Promise . resolve ( ) ;
13+ }
14+
15+ return silentExecAndWaitForOutputToMatch ( 'ng' , [ 'serve' ] , / w e b p a c k : b u n d l e i s n o w V A L I D | w e b p a c k : C o m p i l e d s u c c e s s f u l l y ./ )
16+ // Should trigger a rebuild.
17+ . then ( ( ) => exec ( 'touch' , 'src/main.ts' ) )
18+ . then ( ( ) => waitForAnyProcessOutputToMatch ( / w e b p a c k : b u n d l e i s n o w I N V A L I D | w e b p a c k : C o m p i l i n g .../ , 1000 ) )
19+ . then ( ( ) => waitForAnyProcessOutputToMatch ( / w e b p a c k : b u n d l e i s n o w V A L I D | w e b p a c k : C o m p i l e d s u c c e s s f u l l y ./ , 5000 ) )
20+ . then ( ( ) => appendToFile ( 'src/app/app.component.css' , ':host { color: blue; }' ) )
21+ . then ( ( ) => waitForAnyProcessOutputToMatch ( / w e b p a c k : b u n d l e i s n o w I N V A L I D | w e b p a c k : C o m p i l i n g .../ , 1000 ) )
22+ . then ( ( ) => waitForAnyProcessOutputToMatch ( / w e b p a c k : b u n d l e i s n o w V A L I D | w e b p a c k : C o m p i l e d s u c c e s s f u l l y ./ , 5000 ) )
23+ . then ( ( ) => killAllProcesses ( ) , ( err : any ) => {
24+ killAllProcesses ( ) ;
25+ throw err ;
26+ } ) ;
27+ }
You can’t perform that action at this time.
0 commit comments