@@ -28,7 +28,6 @@ export class WebpackResourceLoader {
28
28
private _reverseDependencies = new Map < string , Set < string > > ( ) ;
29
29
30
30
private fileCache ?: Map < string , CompilationOutput > ;
31
- private inlineCache ?: Map < string , CompilationOutput > ;
32
31
private assetCache ?: Map < string , Asset > ;
33
32
34
33
private modifiedResources = new Set < string > ( ) ;
@@ -39,7 +38,6 @@ export class WebpackResourceLoader {
39
38
constructor ( shouldCache : boolean ) {
40
39
if ( shouldCache ) {
41
40
this . fileCache = new Map ( ) ;
42
- this . inlineCache = new Map ( ) ;
43
41
this . assetCache = new Map ( ) ;
44
42
}
45
43
}
@@ -106,7 +104,6 @@ export class WebpackResourceLoader {
106
104
mimeType ?: string ,
107
105
fileExtension ?: string ,
108
106
resourceType ?: 'style' | 'template' ,
109
- hash ?: string ,
110
107
containingFile ?: string ,
111
108
) : Promise < CompilationOutput > {
112
109
if ( ! this . _parentCompilation ) {
@@ -118,7 +115,8 @@ export class WebpackResourceLoader {
118
115
filePath ||
119
116
( resourceType
120
117
? `${ containingFile } -${ this . outputPathCounter } .${ fileExtension } !=!${ this . inlineDataLoaderPath } !${ containingFile } `
121
- : `angular-resource:${ resourceType } ,${ hash } ` ) ;
118
+ : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
119
+ `angular-resource:${ resourceType } ,${ createHash ( 'md5' ) . update ( data ! ) . digest ( 'hex' ) } ` ) ;
122
120
123
121
if ( ! entry ) {
124
122
throw new Error ( `"filePath" or "data" must be specified.` ) ;
@@ -337,24 +335,14 @@ export class WebpackResourceLoader {
337
335
return '' ;
338
336
}
339
337
340
- const cacheKey = createHash ( 'md5' ) . update ( data ) . digest ( 'hex' ) ;
341
- let compilationResult = this . inlineCache ?. get ( cacheKey ) ;
342
-
343
- if ( compilationResult === undefined ) {
344
- compilationResult = await this . _compile (
345
- undefined ,
346
- data ,
347
- mimeType ,
348
- fileExtension ,
349
- resourceType ,
350
- cacheKey ,
351
- containingFile ,
352
- ) ;
353
-
354
- if ( this . inlineCache && compilationResult . success ) {
355
- this . inlineCache . set ( cacheKey , compilationResult ) ;
356
- }
357
- }
338
+ const compilationResult = await this . _compile (
339
+ undefined ,
340
+ data ,
341
+ mimeType ,
342
+ fileExtension ,
343
+ resourceType ,
344
+ containingFile ,
345
+ ) ;
358
346
359
347
return compilationResult . content ;
360
348
}
0 commit comments