77const Module = require ( "../Module" ) ;
88const Template = require ( "../Template" ) ;
99const Parser = require ( "../Parser" ) ;
10+ const crypto = require ( "crypto" ) ;
1011const acorn = require ( "acorn" ) ;
1112const escope = require ( "escope" ) ;
1213const ReplaceSource = require ( "webpack-sources" ) . ReplaceSource ;
@@ -221,6 +222,7 @@ class ConcatenatedModule extends Module {
221222 }
222223 }
223224 }
225+ this . _identifier = this . _createIdentifier ( ) ;
224226 }
225227
226228 get modules ( ) {
@@ -230,12 +232,7 @@ class ConcatenatedModule extends Module {
230232 }
231233
232234 identifier ( ) {
233- return this . _orderedConcatenationList . map ( info => {
234- switch ( info . type ) {
235- case "concatenated" :
236- return info . module . identifier ( ) ;
237- }
238- } ) . filter ( Boolean ) . join ( " " ) ;
235+ return this . _identifier ;
239236 }
240237
241238 readableIdentifier ( requestShortener ) {
@@ -311,6 +308,18 @@ class ConcatenatedModule extends Module {
311308 return list ;
312309 }
313310
311+ _createIdentifier ( ) {
312+ const orderedConcatenationListIdentifiers = this . _orderedConcatenationList . map ( info => {
313+ switch ( info . type ) {
314+ case "concatenated" :
315+ return info . module . identifier ( ) ;
316+ }
317+ } ) . filter ( Boolean ) . join ( " " ) ;
318+ const hash = crypto . createHash ( "md5" ) ;
319+ hash . update ( orderedConcatenationListIdentifiers ) ;
320+ return this . rootModule . identifier ( ) + " " + hash . digest ( "hex" ) ;
321+ }
322+
314323 source ( dependencyTemplates , outputOptions , requestShortener ) {
315324 // Metainfo for each module
316325 const modulesWithInfo = this . _orderedConcatenationList . map ( ( info , idx ) => {
0 commit comments