File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,10 @@ class ServeCommand {
128128 return ;
129129 }
130130
131+ process . on ( "SIGINT" , ( ) => {
132+ compiler . close ( ) ;
133+ } ) ;
134+
131135 const servers = [ ] ;
132136
133137 if ( cli . needWatchStdin ( compiler ) || devServerCLIOptions . stdin ) {
@@ -153,7 +157,9 @@ class ServeCommand {
153157 } ) ;
154158 } ) ,
155159 ) . then ( ( ) => {
156- process . exit ( 0 ) ;
160+ compiler . close ( ( ) => {
161+ process . exit ( 0 ) ;
162+ } ) ;
157163 } ) ;
158164 } ) ;
159165 process . stdin . resume ( ) ;
Original file line number Diff line number Diff line change @@ -2125,14 +2125,20 @@ class WebpackCLI {
21252125 return ;
21262126 }
21272127
2128+ process . on ( "SIGINT" , ( ) => {
2129+ compiler . close ( ) ;
2130+ } ) ;
2131+
21282132 const isWatch = ( compiler ) =>
21292133 compiler . compilers
21302134 ? compiler . compilers . some ( ( compiler ) => compiler . options . watch )
21312135 : compiler . options . watch ;
21322136
21332137 if ( isWatch ( compiler ) && this . needWatchStdin ( compiler ) ) {
21342138 process . stdin . on ( "end" , ( ) => {
2135- process . exit ( 0 ) ;
2139+ compiler . close ( ( ) => {
2140+ process . exit ( 0 ) ;
2141+ } ) ;
21362142 } ) ;
21372143 process . stdin . resume ( ) ;
21382144 }
You can’t perform that action at this time.
0 commit comments