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