Skip to content

Commit

Permalink
Merge pull request #9603 from noscripter/patch-1
Browse files Browse the repository at this point in the history
refactor: cache always true
  • Loading branch information
sokra committed Aug 26, 2019
2 parents 0601b12 + 9f90ba2 commit b16ca50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -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
Expand Down
26 changes: 12 additions & 14 deletions lib/CachePlugin.js
Expand Up @@ -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);
}
);
});
Expand Down

0 comments on commit b16ca50

Please sign in to comment.