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 6c084e5 commit 0005b1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/index.ts
Expand Up @@ -421,6 +421,18 @@ function updateFileInCache(
instance.changedFilesList = true;
}

// instance.version must be increased when a new root files 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 0005b1d

Please sign in to comment.