@@ -97,7 +97,6 @@ export class WebpackCompilerHost implements ts.CompilerHost {
9797 private _delegate : ts . CompilerHost ;
9898 private _files : { [ path : string ] : VirtualFileStats | null } = Object . create ( null ) ;
9999 private _directories : { [ path : string ] : VirtualDirStats | null } = Object . create ( null ) ;
100- private _cachedResources : { [ path : string ] : string | undefined } = Object . create ( null ) ;
101100
102101 private _changedFiles : { [ path : string ] : boolean } = Object . create ( null ) ;
103102 private _changedDirs : { [ path : string ] : boolean } = Object . create ( null ) ;
@@ -174,8 +173,8 @@ export class WebpackCompilerHost implements ts.CompilerHost {
174173 fileName = this . resolve ( fileName ) ;
175174 if ( fileName in this . _files ) {
176175 this . _files [ fileName ] = null ;
177- this . _changedFiles [ fileName ] = true ;
178176 }
177+ this . _changedFiles [ fileName ] = true ;
179178 }
180179
181180 fileExists ( fileName : string , delegate = true ) : boolean {
@@ -299,22 +298,7 @@ export class WebpackCompilerHost implements ts.CompilerHost {
299298 if ( this . _resourceLoader ) {
300299 // These paths are meant to be used by the loader so we must denormalize them.
301300 const denormalizedFileName = this . denormalizePath ( fileName ) ;
302- const resourceDeps = this . _resourceLoader . getResourceDependencies ( denormalizedFileName ) ;
303-
304- if ( this . _cachedResources [ fileName ] === undefined
305- || resourceDeps . some ( ( dep ) => this . _changedFiles [ this . resolve ( dep ) ] ) ) {
306- return this . _resourceLoader . get ( denormalizedFileName )
307- . then ( ( resource ) => {
308- // Add resource dependencies to the compiler host file list.
309- // This way we can check the changed files list to determine whether to use cache.
310- this . _resourceLoader . getResourceDependencies ( denormalizedFileName )
311- . forEach ( ( dep ) => this . readFile ( dep ) ) ;
312- this . _cachedResources [ fileName ] = resource ;
313- return resource ;
314- } ) ;
315- } else {
316- return this . _cachedResources [ fileName ] ;
317- }
301+ return this . _resourceLoader . get ( denormalizedFileName ) ;
318302 } else {
319303 return this . readFile ( fileName ) ;
320304 }
0 commit comments