webpack-cli icon indicating copy to clipboard operation
webpack-cli copied to clipboard

fix: close compiler on SIGINT

Open snitin315 opened this issue 3 years ago • 6 comments

What kind of change does this PR introduce? fix

Did you add tests for your changes? No If relevant, did you update the documentation? No Summary

Fix #2918

Does this PR introduce a breaking change? None

Other information No

snitin315 avatar Aug 25 '21 11:08 snitin315

Codecov Report

Merging #2919 (52d9a0c) into master (06cd267) will decrease coverage by 0.12%. The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2919      +/-   ##
==========================================
- Coverage   95.13%   95.00%   -0.13%     
==========================================
  Files          31       31              
  Lines        1684     1701      +17     
  Branches      481      484       +3     
==========================================
+ Hits         1602     1616      +14     
- Misses         82       85       +3     
Impacted Files Coverage Δ
packages/webpack-cli/lib/webpack-cli.js 96.34% <77.77%> (-0.18%) :arrow_down:
packages/serve/src/index.ts 84.52% <94.44%> (+0.24%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 06cd267...52d9a0c. Read the comment docs.

codecov[bot] avatar Aug 25 '21 11:08 codecov[bot]

I will add tests

alexander-akait avatar Aug 30 '21 12:08 alexander-akait

@snitin315 We need improve logic here: we need allow to graceful close and allow immutability disable, my idea - when developer run CTRL + C we try to close(), if CTRL + C pressed again we close immediately, also we need handle const signals = ["SIGINT", "SIGTERM"]; signals, for serve we need disable setupExitSignals and move this logic here https://github.com/webpack/webpack-dev-server/blob/master/lib/Server.js#L1088 (in future major release we will remove this option, because it is wrong place for this, developer should handle closing manually)

alexander-akait avatar Sep 06 '21 17:09 alexander-akait

Makes sense, I will update it in near future.

snitin315 avatar Sep 07 '21 11:09 snitin315

@snitin315 hello, let's finish, just copy logic from dev server

alexander-akait avatar Mar 06 '23 09:03 alexander-akait

@alexander-akait sure 👍🏻

snitin315 avatar Mar 06 '23 09:03 snitin315