Skip to content

Commit

Permalink
Use rootDir in the haste map cache name
Browse files Browse the repository at this point in the history
  • Loading branch information
rubennorte committed Oct 1, 2018
1 parent 9a22225 commit 2d84704
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/jest-haste-map/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,13 @@ class HasteMap extends EventEmitter {
'deprecated. Provide a RegExp instead. See https://github.com/facebook/jest/pull/4063.',
);
}
const rootDirHash = crypto
.createHash('md5')
.update(options.rootDir)
.digest('hex');
this._cachePath = HasteMap.getCacheFilePath(
this._options.cacheDirectory,
`haste-map-${this._options.name}`,
`haste-map-${this._options.name}-${rootDirHash}`,
VERSION,
this._options.roots
.map(root => fastPath.relative(options.rootDir, root))
Expand Down

0 comments on commit 2d84704

Please sign in to comment.