@@ -78,7 +78,7 @@ const {
78
78
createFakeHook
79
79
} = require ( "./util/deprecation" ) ;
80
80
const processAsyncTree = require ( "./util/processAsyncTree" ) ;
81
- const { getRuntimeKey, RuntimeSpecMap } = require ( "./util/runtime" ) ;
81
+ const { getRuntimeKey } = require ( "./util/runtime" ) ;
82
82
const { isSourceEqual } = require ( "./util/source" ) ;
83
83
84
84
/** @template T @typedef {import("tapable").AsArray<T>} AsArray<T> */
@@ -3095,16 +3095,11 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3095
3095
// modules with async blocks depend on the chunk graph and can't be cached that way
3096
3096
module . blocks . length === 0 &&
3097
3097
moduleMemCaches . get ( module ) ;
3098
- /** @type {RuntimeSpecMap<Set<string>> } */
3099
- const moduleRuntimeRequirementsMemCache =
3100
- memCache &&
3101
- memCache . provide (
3102
- "moduleRuntimeRequirements" ,
3103
- ( ) => new RuntimeSpecMap ( )
3104
- ) ;
3105
3098
for ( const runtime of chunkGraph . getModuleRuntimes ( module ) ) {
3106
- if ( moduleRuntimeRequirementsMemCache ) {
3107
- const cached = moduleRuntimeRequirementsMemCache . get ( runtime ) ;
3099
+ if ( memCache ) {
3100
+ const cached = memCache . get (
3101
+ `moduleRuntimeRequirements-${ getRuntimeKey ( runtime ) } `
3102
+ ) ;
3108
3103
if ( cached !== undefined ) {
3109
3104
if ( cached !== null ) {
3110
3105
chunkGraph . addModuleRuntimeRequirements (
@@ -3125,8 +3120,11 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3125
3120
} else if ( additionalModuleRuntimeRequirements . isUsed ( ) ) {
3126
3121
set = new Set ( ) ;
3127
3122
} else {
3128
- if ( moduleRuntimeRequirementsMemCache ) {
3129
- moduleRuntimeRequirementsMemCache . set ( runtime , null ) ;
3123
+ if ( memCache ) {
3124
+ memCache . set (
3125
+ `moduleRuntimeRequirements-${ getRuntimeKey ( runtime ) } ` ,
3126
+ null
3127
+ ) ;
3130
3128
}
3131
3129
continue ;
3132
3130
}
@@ -3137,12 +3135,18 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3137
3135
if ( hook !== undefined ) hook . call ( module , set , context ) ;
3138
3136
}
3139
3137
if ( set . size === 0 ) {
3140
- if ( moduleRuntimeRequirementsMemCache ) {
3141
- moduleRuntimeRequirementsMemCache . set ( runtime , null ) ;
3138
+ if ( memCache ) {
3139
+ memCache . set (
3140
+ `moduleRuntimeRequirements-${ getRuntimeKey ( runtime ) } ` ,
3141
+ null
3142
+ ) ;
3142
3143
}
3143
3144
} else {
3144
- if ( moduleRuntimeRequirementsMemCache ) {
3145
- moduleRuntimeRequirementsMemCache . set ( runtime , set ) ;
3145
+ if ( memCache ) {
3146
+ memCache . set (
3147
+ `moduleRuntimeRequirements-${ getRuntimeKey ( runtime ) } ` ,
3148
+ set
3149
+ ) ;
3146
3150
chunkGraph . addModuleRuntimeRequirements (
3147
3151
module ,
3148
3152
runtime ,
@@ -3555,13 +3559,9 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3555
3559
// modules with async blocks depend on the chunk graph and can't be cached that way
3556
3560
module . blocks . length === 0 &&
3557
3561
moduleMemCaches . get ( module ) ;
3558
- /** @type {RuntimeSpecMap<string> } */
3559
- const moduleHashesMemCache =
3560
- memCache &&
3561
- memCache . provide ( "moduleHashes" , ( ) => new RuntimeSpecMap ( ) ) ;
3562
3562
for ( const runtime of chunkGraph . getModuleRuntimes ( module ) ) {
3563
- if ( moduleHashesMemCache ) {
3564
- const digest = moduleHashesMemCache . get ( runtime ) ;
3563
+ if ( memCache ) {
3564
+ const digest = memCache . get ( `moduleHash- ${ getRuntimeKey ( runtime ) } ` ) ;
3565
3565
if ( digest !== undefined ) {
3566
3566
chunkGraph . setModuleHashes (
3567
3567
module ,
@@ -3583,8 +3583,8 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3583
3583
hashDigest ,
3584
3584
hashDigestLength
3585
3585
) ;
3586
- if ( moduleHashesMemCache ) {
3587
- moduleHashesMemCache . set ( runtime , digest ) ;
3586
+ if ( memCache ) {
3587
+ memCache . set ( `moduleHash- ${ getRuntimeKey ( runtime ) } ` , digest ) ;
3588
3588
}
3589
3589
}
3590
3590
}
0 commit comments