Skip to content

Commit

Permalink
Set "compilationDone" before "forkTsCheckerServiceBeforeStart" (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerburgin authored and piotr-oles committed Aug 15, 2018
1 parent 102fba2 commit aea60e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,14 @@ 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
this.cancellationToken.requestCancellation();
this.compiler.hooks.forkTsCheckerCancel.call(this.cancellationToken);
}
this.checkDone = false;
this.compilationDone = false;

this.started = process.hrtime();

Expand All @@ -350,14 +350,14 @@ 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
this.cancellationToken.requestCancellation();
this.compiler.applyPlugins('fork-ts-checker-cancel', this.cancellationToken);
}
this.checkDone = false;
this.compilationDone = false;

this.started = process.hrtime();

Expand Down

0 comments on commit aea60e1

Please sign in to comment.