@@ -24,7 +24,6 @@ export class WebpackResourceLoader {
24
24
private _reverseDependencies = new Map < string , Set < string > > ( ) ;
25
25
26
26
private fileCache ?: Map < string , CompilationOutput > ;
27
- private inlineCache ?: Map < string , CompilationOutput > ;
28
27
private assetCache ?: Map < string , Asset > ;
29
28
30
29
private modifiedResources = new Set < string > ( ) ;
@@ -33,7 +32,6 @@ export class WebpackResourceLoader {
33
32
constructor ( shouldCache : boolean ) {
34
33
if ( shouldCache ) {
35
34
this . fileCache = new Map ( ) ;
36
- this . inlineCache = new Map ( ) ;
37
35
this . assetCache = new Map ( ) ;
38
36
}
39
37
}
@@ -99,15 +97,16 @@ export class WebpackResourceLoader {
99
97
data ?: string ,
100
98
mimeType ?: string ,
101
99
resourceType ?: 'style' | 'template' ,
102
- hash ?: string ,
103
100
containingFile ?: string ,
104
101
) : Promise < CompilationOutput > {
105
102
if ( ! this . _parentCompilation ) {
106
103
throw new Error ( 'WebpackResourceLoader cannot be used without parentCompilation' ) ;
107
104
}
108
105
109
106
// 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 ;
111
110
if ( ! entry ) {
112
111
throw new Error ( `"filePath" or "data" must be specified.` ) ;
113
112
}
@@ -322,23 +321,13 @@ export class WebpackResourceLoader {
322
321
return '' ;
323
322
}
324
323
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
+ ) ;
342
331
343
332
return compilationResult . content ;
344
333
}
0 commit comments