Skip to content

Commit 173202f

Browse files
author
Piotr Oleś
committed
Fix stats error on remove
1 parent 7c64f03 commit 173202f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/IncrementalChecker.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ IncrementalChecker.createProgram = function (programConfig, files, watcher, oldP
4747
host.getSourceFile = function (filePath, languageVersion, onError) {
4848
// first check if watcher is watching file - if not - check it's mtime
4949
if (!watcher.isWatchingFile(filePath)) {
50-
var stats = fs.statSync(filePath);
51-
52-
files.setMtime(filePath, stats.mtime.valueOf());
50+
try {
51+
var stats = fs.statSync(filePath);
52+
53+
files.setMtime(filePath, stats.mtime.valueOf());
54+
} catch (e) {
55+
// probably file does not exists
56+
files.remove(filePath);
57+
}
5358
}
5459

5560
// get source file only if there is no source in files register

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ ForkTsCheckerWebpackPlugin.prototype.spawnService = function () {
234234
}
235235
if (this.tslint && !this.options.tslint) {
236236
// auto-detect tslint path - print to the user to be sure that it's proper file
237-
lines.push(this.colors.grey(this.tslint));
237+
lines.push(this.colors.grey(this.tslintPath));
238238
}
239239

240240
this.logger.info(lines.join('\n'));

0 commit comments

Comments
 (0)