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:
parent
dbe37e7898
commit
fb46e39cad
|
@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue