Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes bug where dev server doesnt close after webpack compile error #167

Merged
merged 2 commits into from
Sep 21, 2016

Conversation

ccpricenytimes
Copy link
Contributor

Fixes #51

The dev server wasn't closing when exiting dev after a Webpack compile error. Now the server exits cleanly.

@delambo
Copy link
Member

delambo commented Sep 20, 2016

Can you ELI5?

@ccpricenytimes
Copy link
Contributor Author

So if someone started up dev and received a Webpack compile error they would see an error message. This prompts some users to ^C in their terminal to stop the dev process and make their changes. But this did not kill the underlying process so when restarting the dev server there was a port in use error (more details in @tizmagik comment in #51) What I've done here is created a way to capture that ^C when the user wants to exit and I shut down the process which cleanly exits the running servers.

Does that make sense?

@@ -18,6 +18,11 @@ const { buildPath, serverSrcPath } = require('../../utils/paths')();
module.exports = (config) => {
logger.start('Starting development build...');

// Kill the server on exit.
process.on('SIGINT', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be

process.on('SIGINT', process.exit);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

@tizmagik tizmagik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@delambo delambo merged commit af786d7 into master Sep 21, 2016
@delambo delambo deleted the fixes-dev-restart branch September 21, 2016 21:44
delambo added a commit that referenced this pull request Sep 22, 2016
* master:
  fixes bug where dev server doesnt close after webpack compile error (#167)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants