@@ -24,7 +24,6 @@ export class WebpackResourceLoader {
2424 private _reverseDependencies = new Map < string , Set < string > > ( ) ;
2525
2626 private fileCache ?: Map < string , CompilationOutput > ;
27- private inlineCache ?: Map < string , CompilationOutput > ;
2827 private assetCache ?: Map < string , Asset > ;
2928
3029 private modifiedResources = new Set < string > ( ) ;
@@ -33,7 +32,6 @@ export class WebpackResourceLoader {
3332 constructor ( shouldCache : boolean ) {
3433 if ( shouldCache ) {
3534 this . fileCache = new Map ( ) ;
36- this . inlineCache = new Map ( ) ;
3735 this . assetCache = new Map ( ) ;
3836 }
3937 }
@@ -99,15 +97,16 @@ export class WebpackResourceLoader {
9997 data ?: string ,
10098 mimeType ?: string ,
10199 resourceType ?: 'style' | 'template' ,
102- hash ?: string ,
103100 containingFile ?: string ,
104101 ) : Promise < CompilationOutput > {
105102 if ( ! this . _parentCompilation ) {
106103 throw new Error ( 'WebpackResourceLoader cannot be used without parentCompilation' ) ;
107104 }
108105
109106 // Create a special URL for reading the resource from memory
110- const entry = data ? `angular-resource:${ resourceType } ,${ hash } ` : filePath ;
107+ const entry = data
108+ ? `angular-resource:${ resourceType } ,${ createHash ( 'md5' ) . update ( data ) . digest ( 'hex' ) } `
109+ : filePath ;
111110 if ( ! entry ) {
112111 throw new Error ( `"filePath" or "data" must be specified.` ) ;
113112 }
@@ -322,23 +321,13 @@ export class WebpackResourceLoader {
322321 return '' ;
323322 }
324323
325- const cacheKey = createHash ( 'md5' ) . update ( data ) . digest ( 'hex' ) ;
326- let compilationResult = this . inlineCache ?. get ( cacheKey ) ;
327-
328- if ( compilationResult === undefined ) {
329- compilationResult = await this . _compile (
330- undefined ,
331- data ,
332- mimeType ,
333- resourceType ,
334- cacheKey ,
335- containingFile ,
336- ) ;
337-
338- if ( this . inlineCache && compilationResult . success ) {
339- this . inlineCache . set ( cacheKey , compilationResult ) ;
340- }
341- }
324+ const compilationResult = await this . _compile (
325+ undefined ,
326+ data ,
327+ mimeType ,
328+ resourceType ,
329+ containingFile ,
330+ ) ;
342331
343332 return compilationResult . content ;
344333 }
0 commit comments