diff --git a/packager/react-packager/src/Cache/index.js b/packager/react-packager/src/Cache/index.js index 708f8cbd7..cbd9e2150 100644 --- a/packager/react-packager/src/Cache/index.js +++ b/packager/react-packager/src/Cache/index.js @@ -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 ); } }