Skip to content

Commit

Permalink
Increase instance version when new root files are added
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Jun 4, 2019
1 parent faf3c14 commit 2414f1b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,17 @@ function updateFileInCache(
instance.changedFilesList = true;
}

// instance.version must be increased when a new root file is added.
//
// Note that the file could actually be in the cache if it was found
// as a dependency before.
//
// See https://github.com/TypeStrong/ts-loader/issues/943
//
if (!instance.rootFileNames.has(filePath)) {
instance.version!++;
}

if (instance.watchHost !== undefined && contents === undefined) {
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted;
}
Expand Down

0 comments on commit 2414f1b

Please sign in to comment.