Skip to content

Commit

Permalink
fix: support new webpack watcher API (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
thers committed Oct 25, 2022
1 parent f7ee867 commit 4124fcd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/VirtualModulePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4124fcd

Please sign in to comment.