@@ -2424,9 +2424,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
24242424 let statNew = 0 ;
24252425 /**
24262426 * @param {Module } module module
2427- * @returns {{ modules?: Map<Module, string | number | undefined>, blocks?: (string | number)[] } } references
2427+ * @returns {{ id: string | number, modules?: Map<Module, string | number | undefined>, blocks?: (string | number)[] } } references
24282428 */
24292429 const computeReferences = module => {
2430+ const id = chunkGraph . getModuleId ( module ) ;
24302431 /** @type {Map<Module, string | number | undefined> } */
24312432 let modules = undefined ;
24322433 /** @type {(string | number)[] | undefined } */
@@ -2454,16 +2455,18 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
24542455 queue . push . apply ( queue , block . blocks ) ;
24552456 }
24562457 }
2457- return { modules, blocks } ;
2458+ return { id , modules, blocks } ;
24582459 } ;
24592460 /**
24602461 * @param {Module } module module
24612462 * @param {Object } references references
2463+ * @param {string | number } references.id id
24622464 * @param {Map<Module, string | number>= } references.modules modules
24632465 * @param {(string | number)[]= } references.blocks blocks
24642466 * @returns {boolean } ok?
24652467 */
2466- const compareReferences = ( module , { modules, blocks } ) => {
2468+ const compareReferences = ( module , { id, modules, blocks } ) => {
2469+ if ( id !== chunkGraph . getModuleId ( module ) ) return false ;
24672470 if ( modules !== undefined ) {
24682471 for ( const [ module , id ] of modules ) {
24692472 if ( chunkGraph . getModuleId ( module ) !== id ) return false ;
@@ -2489,7 +2492,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
24892492 } ;
24902493
24912494 for ( const [ module , memCache ] of moduleMemCaches ) {
2492- /** @type {{ references: { modules?: Map<Module, string | number | undefined>, blocks?: (string | number)[]}, memCache: WeakTupleMap<any[], any> } } */
2495+ /** @type {{ references: { id: string | number, modules?: Map<Module, string | number | undefined>, blocks?: (string | number)[]}, memCache: WeakTupleMap<any[], any> } } */
24932496 const cache = memCache . get ( key ) ;
24942497 if ( cache === undefined ) {
24952498 const memCache2 = new WeakTupleMap ( ) ;
0 commit comments