diff --git a/src/VirtualModulePlugin.ts b/src/VirtualModulePlugin.ts index a2ad8375..829fff11 100644 --- a/src/VirtualModulePlugin.ts +++ b/src/VirtualModulePlugin.ts @@ -167,10 +167,14 @@ class VirtualModulesPlugin { : finalWatchFileSystem.watcher.fileWatchers; fileWatchers.forEach((fileWatcher) => { - if (fileWatcher.path === filePath) { + const fileWatcherPath = fileWatcher.path || fileWatcher.watcher.path; + + if (fileWatcherPath === filePath) { + const fileWatcherDirectoryWatcher = fileWatcher.directoryWatcher || fileWatcher.watcher.directoryWatcher; + debug(this.compiler.name, 'Emit file change:', filePath, time); - // delete fileWatcher.directoryWatcher._cachedTimeInfoEntries; - fileWatcher.directoryWatcher.setFileTime( + // delete fileWatcherDirectoryWatcher._cachedTimeInfoEntries; + fileWatcherDirectoryWatcher.setFileTime( filePath, time, false,