Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class VirtualModulesPlugin {
birthtime: date,
});
const modulePath = getModulePath(filePath, this._compiler);
const fts = this._compiler.fileTimestamps as any;

if (process.env.DEBUG)
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -166,6 +167,9 @@ class VirtualModulesPlugin {
if (process.env.DEBUG)
// eslint-disable-next-line no-console
console.log(this._compiler.name, 'Emit file change:', modulePath, time);

if (fts && typeof fts.set === 'function' && fts.get(modulePath)) fts.set(modulePath, time);

delete fileWatcher.directoryWatcher._cachedTimeInfoEntries;
fileWatcher.directoryWatcher.setFileTime(filePath, time, false, false, null);
fileWatcher.emit('change', time, null);
Expand Down