@@ -5,7 +5,6 @@ import * as Webpack from 'webpack';
5
5
import * as lodash from 'lodash' ;
6
6
7
7
import { Constants } from './utilities/Constants' ;
8
- import { EntityMarker } from './utilities/EntityMarker' ;
9
8
import { ILocaleElementMap } from './interfaces' ;
10
9
import { LocalizationPlugin , IStringSerialNumberData as IStringData } from './LocalizationPlugin' ;
11
10
@@ -62,6 +61,7 @@ export interface IProcessAssetOptionsBase {
62
61
asset : IAsset ;
63
62
chunk : Webpack . compilation . Chunk ;
64
63
noStringsLocaleName : string ;
64
+ chunkHasLocalizedModules : ( chunk : Webpack . compilation . Chunk ) => boolean ;
65
65
}
66
66
67
67
export interface IProcessNonLocalizedAssetOptions extends IProcessAssetOptionsBase { }
@@ -94,7 +94,7 @@ export class AssetProcessor {
94
94
const parsedAsset : IParseResult = AssetProcessor . _parseStringToReconstructionSequence (
95
95
options . plugin ,
96
96
assetSource ,
97
- this . _getJsonpFunction ( options . chunk , options . noStringsLocaleName )
97
+ this . _getJsonpFunction ( options . chunk , options . chunkHasLocalizedModules , options . noStringsLocaleName )
98
98
) ;
99
99
const reconstructedAsset : ILocalizedReconstructionResult = AssetProcessor . _reconstructLocalized (
100
100
parsedAsset . reconstructionSeries ,
@@ -154,7 +154,7 @@ export class AssetProcessor {
154
154
const parsedAsset : IParseResult = AssetProcessor . _parseStringToReconstructionSequence (
155
155
options . plugin ,
156
156
assetSource ,
157
- this . _getJsonpFunction ( options . chunk , options . noStringsLocaleName )
157
+ this . _getJsonpFunction ( options . chunk , options . chunkHasLocalizedModules , options . noStringsLocaleName )
158
158
) ;
159
159
const reconstructedAsset : INonLocalizedReconstructionResult = AssetProcessor . _reconstructNonLocalized (
160
160
parsedAsset . reconstructionSeries ,
@@ -417,14 +417,15 @@ export class AssetProcessor {
417
417
418
418
private static _getJsonpFunction (
419
419
chunk : Webpack . compilation . Chunk ,
420
+ chunkHasLocalizedModules : ( chunk : Webpack . compilation . Chunk ) => boolean ,
420
421
noStringsLocaleName : string
421
422
) : ( locale : string , chunkIdToken : string | undefined ) => string {
422
423
const idsWithStrings : Set < string > = new Set < string > ( ) ;
423
424
const idsWithoutStrings : Set < string > = new Set < string > ( ) ;
424
425
425
426
const asyncChunks : Set < Webpack . compilation . Chunk > = chunk . getAllAsyncChunks ( ) ;
426
427
for ( const asyncChunk of asyncChunks ) {
427
- if ( EntityMarker . getMark ( asyncChunk ) ) {
428
+ if ( chunkHasLocalizedModules ( asyncChunk ) ) {
428
429
idsWithStrings . add ( asyncChunk . id ) ;
429
430
} else {
430
431
idsWithoutStrings . add ( asyncChunk . id ) ;
0 commit comments