Skip to content

Commit

Permalink
Make the modification time of the transformer file relevant for the c…
Browse files Browse the repository at this point in the history
…ache.

Reviewed By: amasad

Differential Revision: D2554956

fb-gh-sync-id: cc76f083594aac04c74a4ef271305238b06710eb
  • Loading branch information
davidaurelio authored and facebook-github-bot-9 committed Oct 20, 2015
1 parent aff65ba commit 8b73423
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions react-packager/src/Cache/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,21 @@ class Cache {
}

_getCacheFilePath(options) {
let mtime;
try {
({mtime} = fs.statSync(options.transformModulePath));
mtime = String(mtime.getTime());
} catch (error) {
mtime = '';
}

return getCacheFilePath(
'react-packager-cache-',
version,
options.projectRoots.join(',').split(path.sep).join('-'),
options.cacheVersion || '0',
options.transformModulePath,
mtime
);
}
}
Expand Down

0 comments on commit 8b73423

Please sign in to comment.