Skip to content

Commit 2a1348d

Browse files
authored
fix: only invoke WDS tap when there are issues (#547)
`webpack-dev-server` always performs a hot reload when its `sync` tap runs. As a result, `fork-ts-checker-webpack-plugin` triggers a hot reload upon completion in `async` mode even when no issues are reported. This commit adds a check for issues before invoking `webpack-dev-server`'s `sync` tap, which eliminates the unneeded reload.
1 parent db5a181 commit 2a1348d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hooks/tapDoneToAsyncGetIssues.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ function tapDoneToAsyncGetIssues(
6767
configuration.logger.issues.log(chalk.green('No issues found.'));
6868
}
6969

70-
if (state.webpackDevServerDoneTap) {
70+
// report issues to webpack-dev-server, if it's listening
71+
// skip reporting if there are no issues, to avoid an extra hot reload
72+
if (issues.length && state.webpackDevServerDoneTap) {
7173
issues.forEach((issue) => {
7274
const error = new IssueWebpackError(configuration.formatter(issue), issue);
7375

0 commit comments

Comments
 (0)