Make the modification time of the transformer file relevant for the cache.

Reviewed By: amasad

Differential Revision: D2554956

fb-gh-sync-id: cc76f083594aac04c74a4ef271305238b06710eb
This commit is contained in:
David Aurelio 2015-10-20 09:44:24 -07:00 committed by facebook-github-bot-9
parent dbe37e7898
commit fb46e39cad
1 changed files with 9 additions and 0 deletions

View File

@ -189,12 +189,21 @@ class Cache {
} }
_getCacheFilePath(options) { _getCacheFilePath(options) {
let mtime;
try {
({mtime} = fs.statSync(options.transformModulePath));
mtime = String(mtime.getTime());
} catch (error) {
mtime = '';
}
return getCacheFilePath( return getCacheFilePath(
'react-packager-cache-', 'react-packager-cache-',
version, version,
options.projectRoots.join(',').split(path.sep).join('-'), options.projectRoots.join(',').split(path.sep).join('-'),
options.cacheVersion || '0', options.cacheVersion || '0',
options.transformModulePath, options.transformModulePath,
mtime
); );
} }
} }