Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2 from smacker/fix.generateCacheKey
Browse files Browse the repository at this point in the history
Fix generateCacheKey with different layers
  • Loading branch information
Kir Belevich committed Feb 1, 2016
2 parents 761e938 + 4232003 commit 2b5188f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ function parseRequiredString(requiredString) {
}

function generateCacheKey(required, currentPath, layers) {
const layersCache = loaderUtils.getHashDigest(layers.toString());
const currentLayerIndex = getCurrentLayerIndex(currentPath, layers);
const currentLayer = layers[currentLayerIndex];
const requiredFile = path.join(required.component, currentLayer.files.main);
const result = currentLayerIndex + '#' + required.component + JSON.stringify(required.opts);
const result = layersCache + '-' + currentLayerIndex +
'#' + required.component + JSON.stringify(required.opts);

if (currentPath.length - currentPath.lastIndexOf(requiredFile) === requiredFile.length) {
return result + currentPath;
Expand Down

0 comments on commit 2b5188f

Please sign in to comment.