Skip to content

Commit

Permalink
fix: use 'afterCompile' hook to fix regression described in #57
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-oles committed Apr 18, 2020
1 parent 9439a09 commit f88e381
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions src/ForkTsCheckerWebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ import { createForkTsCheckerWebpackPluginConfiguration } from './ForkTsCheckerWe
import { createForkTsCheckerWebpackPluginState } from './ForkTsCheckerWebpackPluginState';
import { composeReporterRpcClients, createAggregatedReporter, ReporterRpcClient } from './reporter';
import { assertTypeScriptSupport } from './typescript-reporter/assertTypeScriptSupport';
import {
createTypeScriptReporterRpcClient,
createTypeScriptReporterSameProcessRpcClient,
} from './typescript-reporter/reporter/TypeScriptReporterRpcClient';
import { createTypeScriptReporterRpcClient } from './typescript-reporter/reporter/TypeScriptReporterRpcClient';
import { assertEsLintSupport } from './eslint-reporter/assertEsLintSupport';
import { createEsLintReporterRpcClient } from './eslint-reporter/reporter/EsLintReporterRpcClient';
import { tapDoneToAsyncGetIssues } from './hooks/tapDoneToAsyncGetIssues';
import { tapInvalidToUpdateState } from './hooks/tapInvalidToUpdateState';
import { tapStartToConnectAndRunReporter } from './hooks/tapStartToConnectAndRunReporter';
import { tapStopToDisconnectReporter } from './hooks/tapStopToDisconnectReporter';
import { tapEmitToGetIssues } from './hooks/tapEmitToGetIssues';
import { tapAfterCompileToGetIssues } from './hooks/tapAfterCompileToGetIssues';
import { getForkTsCheckerWebpackPluginHooks } from './hooks/pluginHooks';

class ForkTsCheckerWebpackPlugin implements webpack.Plugin {
Expand Down Expand Up @@ -52,7 +49,7 @@ class ForkTsCheckerWebpackPlugin implements webpack.Plugin {
if (configuration.async) {
tapDoneToAsyncGetIssues(compiler, configuration, state);
} else {
tapEmitToGetIssues(compiler, configuration, state);
tapAfterCompileToGetIssues(compiler, configuration, state);
}
} else {
configuration.logger.infrastructure.error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { Tap } from 'tapable';
import { getReportProgress } from './getReportProgress';
import { Issue } from '../issue';

function tapEmitToGetIssues(
function tapAfterCompileToGetIssues(
compiler: webpack.Compiler,
configuration: ForkTsCheckerWebpackPluginConfiguration,
state: ForkTsCheckerWebpackPluginState
) {
const hooks = getForkTsCheckerWebpackPluginHooks(compiler);

compiler.hooks.emit.tapPromise(
compiler.hooks.afterCompile.tapPromise(
{
name: 'ForkTsCheckerWebpackPlugin',
context: true,
Expand Down Expand Up @@ -66,4 +66,4 @@ function tapEmitToGetIssues(
);
}

export { tapEmitToGetIssues };
export { tapAfterCompileToGetIssues };

0 comments on commit f88e381

Please sign in to comment.