@@ -90,7 +90,7 @@ type ItemCacheFacade = ReturnType<ReturnType<Compilation['getCache']>['getItemCa
9090export async function processLocalizedAssetCachedAsync (
9191 options : IProcessLocalizedAssetOptions
9292) : Promise < Record < string , string > > {
93- const { compilation, asset, cache } = options ;
93+ const { compilation, asset, cache, chunk } = options ;
9494 const { source : originalSource } = asset ;
9595
9696 type ETag = NonNullable < ReturnType < typeof cache . getLazyHashedEtag > > ;
@@ -104,7 +104,11 @@ export async function processLocalizedAssetCachedAsync(
104104 await cacheItem . storePromise ( output ) ;
105105 }
106106
107- for ( const { filename, source, info } of output . processedAssets ) {
107+ const { localizedFiles, processedAssets } = output ;
108+
109+ ( chunk as ILocalizedWebpackChunk ) . localizedFiles = localizedFiles ;
110+
111+ for ( const { filename, source, info } of processedAssets ) {
108112 if ( originName === filename ) {
109113 // This helper throws if the asset doesn't already exist
110114 // Use the function form so that the object identity of `related` is preserved.
@@ -116,7 +120,7 @@ export async function processLocalizedAssetCachedAsync(
116120 }
117121 }
118122
119- return output . localizedFiles ;
123+ return localizedFiles ;
120124}
121125
122126export function processLocalizedAsset ( options : IProcessLocalizedAssetOptions ) : IProcessLocalizedAssetResult {
@@ -141,7 +145,6 @@ export function processLocalizedAsset(options: IProcessLocalizedAssetOptions): I
141145 const { issues } = parsedAsset ;
142146
143147 const localizedFiles : Record < string , string > = { } ;
144- ( chunk as ILocalizedWebpackChunk ) . localizedFiles = localizedFiles ;
145148
146149 const processedAssets : IProcessedAsset [ ] = [ ] ;
147150
0 commit comments