mirror of https://github.com/webpack/webpack.git
				
				
				
			Merge pull request #9603 from noscripter/patch-1
refactor: cache always true
This commit is contained in:
		
						commit
						b16ca509d1
					
				| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
/node_modules
 | 
			
		||||
/test/js
 | 
			
		||||
/test/browsertest/js
 | 
			
		||||
/test/fixtures/temp-cache-fixture
 | 
			
		||||
/test/fixtures/temp-cache-fixture*
 | 
			
		||||
/benchmark/js
 | 
			
		||||
/benchmark/fixtures
 | 
			
		||||
/examples/**/dist
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,21 +24,19 @@ class CachePlugin {
 | 
			
		|||
					compilation.hooks.childCompiler.tap(
 | 
			
		||||
						"CachePlugin",
 | 
			
		||||
						(childCompiler, compilerName, compilerIndex) => {
 | 
			
		||||
							if (cache) {
 | 
			
		||||
								let childCache;
 | 
			
		||||
								if (!cache.children) {
 | 
			
		||||
									cache.children = {};
 | 
			
		||||
								}
 | 
			
		||||
								if (!cache.children[compilerName]) {
 | 
			
		||||
									cache.children[compilerName] = [];
 | 
			
		||||
								}
 | 
			
		||||
								if (cache.children[compilerName][compilerIndex]) {
 | 
			
		||||
									childCache = cache.children[compilerName][compilerIndex];
 | 
			
		||||
								} else {
 | 
			
		||||
									cache.children[compilerName].push((childCache = {}));
 | 
			
		||||
								}
 | 
			
		||||
								registerCacheToCompiler(childCompiler, childCache);
 | 
			
		||||
							let childCache;
 | 
			
		||||
							if (!cache.children) {
 | 
			
		||||
								cache.children = {};
 | 
			
		||||
							}
 | 
			
		||||
							if (!cache.children[compilerName]) {
 | 
			
		||||
								cache.children[compilerName] = [];
 | 
			
		||||
							}
 | 
			
		||||
							if (cache.children[compilerName][compilerIndex]) {
 | 
			
		||||
								childCache = cache.children[compilerName][compilerIndex];
 | 
			
		||||
							} else {
 | 
			
		||||
								cache.children[compilerName].push((childCache = {}));
 | 
			
		||||
							}
 | 
			
		||||
							registerCacheToCompiler(childCompiler, childCache);
 | 
			
		||||
						}
 | 
			
		||||
					);
 | 
			
		||||
				});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue