diff --git a/lib/virtual.js b/lib/virtual.js index 307e2c27..2406a7f6 100644 --- a/lib/virtual.js +++ b/lib/virtual.js @@ -34,11 +34,24 @@ function VirtualModulesPlugin(compiler) { this._virtualFiles[file] = { stats: stats, contents: contents }; setData(this._statStorage, file, [null, stats]); setData(this._readFileStorage, file, [null, contents]); + compiler.fileTimestamps.set(file, +stats.mtime); }; } const watchRunHook = (watcher, callback) => { this._watcher = watcher.compiler || watcher; + + var virtualFiles = this.compiler.inputFileSystem._virtualFiles; + + if (virtualFiles) { + Object.keys(virtualFiles).forEach( + function(file) { + var mtime = +virtualFiles[file].stats.mtime; + compiler.fileTimestamps.set(file, mtime); + } + ); + } + callback(); };