Skip to content

Commit 77effc8

Browse files
authored
fix: close service on the failed hook (#415)
When a compilation is not successful and webpack is not watching, the plugin should close the service. ✅ Closes: #411
1 parent 5bdc643 commit 77effc8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fork-ts-checker-webpack-plugin.tgz

44.7 KB
Binary file not shown.

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,15 @@ class ForkTsCheckerWebpackPlugin {
340340
this.killService();
341341
};
342342

343-
const done = () => {
343+
const doneOrFailed = () => {
344344
if (!this.isWatching) {
345345
this.killService();
346346
}
347347
};
348348

349349
this.compiler.hooks.watchClose.tap(checkerPluginName, watchClose);
350-
this.compiler.hooks.done.tap(checkerPluginName, done);
350+
this.compiler.hooks.done.tap(checkerPluginName, doneOrFailed);
351+
this.compiler.hooks.failed.tap(checkerPluginName, doneOrFailed);
351352

352353
process.on('exit', () => {
353354
this.killService();
@@ -610,11 +611,10 @@ class ForkTsCheckerWebpackPlugin {
610611
this.logger.error(
611612
chalk.red(
612613
'Type checking and linting interrupted - If running in a docker container, this may be caused ' +
613-
'by the container running out of memory. If so, try increasing the container\'s memory limit ' +
614+
"by the container running out of memory. If so, try increasing the container's memory limit " +
614615
'or lowering the memoryLimit value in the ForkTsCheckerWebpackPlugin configuration.'
615616
)
616617
);
617-
618618
} else {
619619
this.logger.error(
620620
chalk.red(

0 commit comments

Comments
 (0)