File tree Expand file tree Collapse file tree 2 files changed +13
-27
lines changed Expand file tree Collapse file tree 2 files changed +13
-27
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ const colors = require('./utils/colors');
13
13
const routes = require ( './utils/routes' ) ;
14
14
const getSocketServerImplementation = require ( './utils/getSocketServerImplementation' ) ;
15
15
const getCompilerConfigArray = require ( './utils/getCompilerConfigArray' ) ;
16
- const setupExitSignals = require ( './utils/setupExitSignals' ) ;
17
16
const getStatsOption = require ( './utils/getStatsOption' ) ;
18
17
const schema = require ( './options.json' ) ;
19
18
@@ -65,7 +64,19 @@ class Server {
65
64
this . createServer ( ) ;
66
65
67
66
killable ( this . server ) ;
68
- setupExitSignals ( this ) ;
67
+
68
+ if ( this . options . setupExitSignals ) {
69
+ const signals = [ 'SIGINT' , 'SIGTERM' ] ;
70
+
71
+ signals . forEach ( ( signal ) => {
72
+ process . on ( signal , ( ) => {
73
+ this . close ( ( ) => {
74
+ // eslint-disable-next-line no-process-exit
75
+ process . exit ( ) ;
76
+ } ) ;
77
+ } ) ;
78
+ } ) ;
79
+ }
69
80
70
81
// Proxy WebSocket without the initial http request
71
82
// https://github.com/chimurai/http-proxy-middleware#external-websocket-upgrade
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments