File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ const identToLoaderRequest = resultString => {
46
46
}
47
47
} ;
48
48
49
+ const dependencyCache = new WeakMap ( ) ;
50
+
49
51
class NormalModuleFactory extends Tapable {
50
52
constructor ( context , resolverFactory , options ) {
51
53
super ( ) ;
@@ -329,7 +331,7 @@ class NormalModuleFactory extends Tapable {
329
331
330
332
create ( data , callback ) {
331
333
const dependencies = data . dependencies ;
332
- const cacheEntry = dependencies [ 0 ] . __NormalModuleFactoryCache ;
334
+ const cacheEntry = dependencyCache . get ( dependencies [ 0 ] ) ;
333
335
if ( cacheEntry ) return callback ( null , cacheEntry ) ;
334
336
const context = data . context || this . context ;
335
337
const resolveOptions = data . resolveOptions || EMPTY_RESOLVE_OPTIONS ;
@@ -359,7 +361,7 @@ class NormalModuleFactory extends Tapable {
359
361
360
362
if ( module && this . cachePredicate ( module ) ) {
361
363
for ( const d of dependencies ) {
362
- d . __NormalModuleFactoryCache = module ;
364
+ dependencyCache . set ( d , module ) ;
363
365
}
364
366
}
365
367
You can’t perform that action at this time.
0 commit comments