katoikia-app/web-ui/web-react/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js

22 lines
472 B
JavaScript

'use strict';
const signals = ['SIGINT', 'SIGTERM'];
function setupExitSignals(serverData) {
signals.forEach((signal) => {
process.on(signal, () => {
if (serverData.server) {
serverData.server.close(() => {
// eslint-disable-next-line no-process-exit
process.exit();
});
} else {
// eslint-disable-next-line no-process-exit
process.exit();
}
});
});
}
module.exports = setupExitSignals;