File tree 3 files changed +12
-2
lines changed
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 {
91
91
private _delegate : ts . CompilerHost ;
92
92
private _files : { [ path : string ] : VirtualFileStats } = Object . create ( null ) ;
93
93
private _directories : { [ path : string ] : VirtualDirStats } = Object . create ( null ) ;
94
+ private _changed = false ;
94
95
95
96
constructor ( private _options : ts . CompilerOptions , private _setParentNodes = true ) {
96
97
this . _delegate = ts . createCompilerHost ( this . _options , this . _setParentNodes ) ;
@@ -104,10 +105,15 @@ export class WebpackCompilerHost implements ts.CompilerHost {
104
105
this . _directories [ p ] = new VirtualDirStats ( p ) ;
105
106
p = dirname ( p ) ;
106
107
}
108
+
109
+ this . _changed = true ;
107
110
}
108
111
109
112
populateWebpackResolver ( resolver : any ) {
110
113
const fs = resolver . fileSystem ;
114
+ if ( ! this . _changed ) {
115
+ return ;
116
+ }
111
117
112
118
for ( const fileName of Object . keys ( this . _files ) ) {
113
119
const stats = this . _files [ fileName ] ;
@@ -121,6 +127,8 @@ export class WebpackCompilerHost implements ts.CompilerHost {
121
127
fs . _statStorage . data [ path ] = [ null , stats ] ;
122
128
fs . _readdirStorage . data [ path ] = [ null , files . concat ( dirs ) ] ;
123
129
}
130
+
131
+ this . _changed = false ;
124
132
}
125
133
126
134
fileExists ( fileName : string ) : boolean {
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export class NgcWebpackPlugin {
119
119
120
120
// Virtual file system.
121
121
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.
123
123
this . compilerHost . populateWebpackResolver ( compiler . resolvers . normal ) ;
124
124
if ( cb ) {
125
125
cb ( ) ;
Original file line number Diff line number Diff line change @@ -17,5 +17,7 @@ export default function() {
17
17
return expectToFail ( ( ) => ng ( 'e2e' ) )
18
18
// These should work.
19
19
. then ( ( ) => _runServeAndE2e ( ) )
20
- . then ( ( ) => _runServeAndE2e ( '--prod' ) ) ;
20
+ . then ( ( ) => _runServeAndE2e ( '--prod' ) )
21
+ . then ( ( ) => _runServeAndE2e ( '--aot' ) )
22
+ . then ( ( ) => _runServeAndE2e ( '--aot' , '--prod' ) ) ;
21
23
}
You can’t perform that action at this time.
0 commit comments