File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ const identToLoaderRequest = resultString => {
4646 }
4747} ;
4848
49+ const dependencyCache = new WeakMap ( ) ;
50+
4951class NormalModuleFactory extends Tapable {
5052 constructor ( context , resolverFactory , options ) {
5153 super ( ) ;
@@ -329,7 +331,7 @@ class NormalModuleFactory extends Tapable {
329331
330332 create ( data , callback ) {
331333 const dependencies = data . dependencies ;
332- const cacheEntry = dependencies [ 0 ] . __NormalModuleFactoryCache ;
334+ const cacheEntry = dependencyCache . get ( dependencies [ 0 ] ) ;
333335 if ( cacheEntry ) return callback ( null , cacheEntry ) ;
334336 const context = data . context || this . context ;
335337 const resolveOptions = data . resolveOptions || EMPTY_RESOLVE_OPTIONS ;
@@ -359,7 +361,7 @@ class NormalModuleFactory extends Tapable {
359361
360362 if ( module && this . cachePredicate ( module ) ) {
361363 for ( const d of dependencies ) {
362- d . __NormalModuleFactoryCache = module ;
364+ dependencyCache . set ( d , module ) ;
363365 }
364366 }
365367
You can’t perform that action at this time.
0 commit comments