You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
1.0 KiB

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tapStopToTerminateWorkers = void 0;
const infrastructure_logger_1 = require("../infrastructure-logger");
function tapStopToTerminateWorkers(compiler, getIssuesWorker, getDependenciesWorker, state) {
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
const terminateWorkers = () => {
debug('Compiler is going to close - terminating workers...');
getIssuesWorker.terminate();
getDependenciesWorker.terminate();
};
compiler.hooks.watchClose.tap('ForkTsCheckerWebpackPlugin', () => {
terminateWorkers();
});
compiler.hooks.done.tap('ForkTsCheckerWebpackPlugin', () => {
if (!state.watching) {
terminateWorkers();
}
});
compiler.hooks.failed.tap('ForkTsCheckerWebpackPlugin', () => {
if (!state.watching) {
terminateWorkers();
}
});
}
exports.tapStopToTerminateWorkers = tapStopToTerminateWorkers;