ProjectEvergreen / greenwood

Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.
https://www.greenwoodjs.io
MIT License
98 stars 10 forks source link

ensure proper termination of server plugins when Greenwood process ends #539

Open thescientist13 opened 3 years ago

thescientist13 commented 3 years ago

Type of Change

Summary

Should really import the stop methods for both servers in Greenwood. This is especially true for the live dev server, something the process does get shut down correctly and then an error could show with the live reload server still running in the background.

Details

This would apply to:

Need to make sure there stop methods get called and appropriately shut everything both down, with the main use case being when a user does something like ctr+c to kill the dev server and so we would probably want to listen for a process exit callback?

Not sure if this could also be helpful for unit testing the dev server for #47 ?

thescientist13 commented 1 year ago

Would also add for a build task, since we start servers for pre-rendering, this means we have to use process.exit in CLI entry point.