1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js

22 lines
486 B
JavaScript
Raw Permalink Normal View History

2023-12-18 13:12:25 +08:00
'use strict';
const signals = ['SIGINT', 'SIGTERM'];
function setupExitSignals(serverData) {
signals.forEach((signal) => {
process.on(signal, () => {
2024-01-16 21:26:16 +08:00
if (serverData && serverData.server) {
2023-12-18 13:12:25 +08:00
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;