diff --git a/src/index.ts b/src/index.ts index c104d941..20d365c7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -319,6 +319,7 @@ class ForkTsCheckerWebpackPlugin { if ('hooks' in this.compiler) { // webpack 4 this.compiler.hooks.compile.tap(checkerPluginName, () => { + this.compilationDone = false; this.compiler.hooks.forkTsCheckerServiceBeforeStart.callAsync(() => { if (this.cancellationToken) { // request cancellation if there is not finished job @@ -326,7 +327,6 @@ class ForkTsCheckerWebpackPlugin { this.compiler.hooks.forkTsCheckerCancel.call(this.cancellationToken); } this.checkDone = false; - this.compilationDone = false; this.started = process.hrtime(); @@ -350,6 +350,7 @@ class ForkTsCheckerWebpackPlugin { } else { // webpack 2 / 3 this.compiler.plugin('compile', () => { + this.compilationDone = false; this.compiler.applyPluginsAsync('fork-ts-checker-service-before-start', () => { if (this.cancellationToken) { // request cancellation if there is not finished job @@ -357,7 +358,6 @@ class ForkTsCheckerWebpackPlugin { this.compiler.applyPlugins('fork-ts-checker-cancel', this.cancellationToken); } this.checkDone = false; - this.compilationDone = false; this.started = process.hrtime();