File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ export class WebpackCompilerHost implements ts.CompilerHost {
9191 private _delegate : ts . CompilerHost ;
9292 private _files : { [ path : string ] : VirtualFileStats } = Object . create ( null ) ;
9393 private _directories : { [ path : string ] : VirtualDirStats } = Object . create ( null ) ;
94+ private _changed = false ;
9495
9596 constructor ( private _options : ts . CompilerOptions , private _setParentNodes = true ) {
9697 this . _delegate = ts . createCompilerHost ( this . _options , this . _setParentNodes ) ;
@@ -104,10 +105,15 @@ export class WebpackCompilerHost implements ts.CompilerHost {
104105 this . _directories [ p ] = new VirtualDirStats ( p ) ;
105106 p = dirname ( p ) ;
106107 }
108+
109+ this . _changed = true ;
107110 }
108111
109112 populateWebpackResolver ( resolver : any ) {
110113 const fs = resolver . fileSystem ;
114+ if ( ! this . _changed ) {
115+ return ;
116+ }
111117
112118 for ( const fileName of Object . keys ( this . _files ) ) {
113119 const stats = this . _files [ fileName ] ;
@@ -121,6 +127,8 @@ export class WebpackCompilerHost implements ts.CompilerHost {
121127 fs . _statStorage . data [ path ] = [ null , stats ] ;
122128 fs . _readdirStorage . data [ path ] = [ null , files . concat ( dirs ) ] ;
123129 }
130+
131+ this . _changed = false ;
124132 }
125133
126134 fileExists ( fileName : string ) : boolean {
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export class NgcWebpackPlugin {
119119
120120 // Virtual file system.
121121 compiler . resolvers . normal . plugin ( 'resolve' , ( request : any , cb ?: ( ) => void ) => {
122- // populate the file system cache with the virtual module
122+ // Populate the file system cache with the virtual module.
123123 this . compilerHost . populateWebpackResolver ( compiler . resolvers . normal ) ;
124124 if ( cb ) {
125125 cb ( ) ;
Original file line number Diff line number Diff line change @@ -17,5 +17,7 @@ export default function() {
1717 return expectToFail ( ( ) => ng ( 'e2e' ) )
1818 // These should work.
1919 . then ( ( ) => _runServeAndE2e ( ) )
20- . then ( ( ) => _runServeAndE2e ( '--prod' ) ) ;
20+ . then ( ( ) => _runServeAndE2e ( '--prod' ) )
21+ . then ( ( ) => _runServeAndE2e ( '--aot' ) )
22+ . then ( ( ) => _runServeAndE2e ( '--aot' , '--prod' ) ) ;
2123}
You can’t perform that action at this time.
0 commit comments