-
Notifications
You must be signed in to change notification settings - Fork 810
Stop sirv before reloading rollup #213
base: master
Are you sure you want to change the base?
Conversation
Fixes sveltejs#199 Rollup reloads the config on detecting changes in it. This should also restart the `sirv` server. But the current config keeps creating new instances of `sirv` on each reload without properly stopping the previous ones. This PR fixes that behaviour.
I'm not convinced that killing the process by spawning I've not noticed the template spinning up endless copies of |
@antony You'll probably notice the issue if you try to edit and save rollbar config while the server is running as mentioned in the attached issue |
}, | ||
/* Rollup restarts on detecting changes to this config file. | ||
This hook makes sure the previously started sirv instance is stopped before starting a new one */ | ||
closeWatcher: toExit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main fix here.
I think we can skip the kill
workaround by just removing shell: true
on the spawner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried that, but a shell is spawned regardless. The shell is spawned by npm.
* Properly restart server on code changes on Linux (based on sveltejs/template#213) * Add a short delay before reloading to wait for any dependencies to finish saving
* Properly restart server on code changes on Linux (based on sveltejs/template#213) * Add a short delay before reloading to wait for any dependencies to finish saving
Fixes #199
Rollup reloads the config on detecting changes in it. This should also restart the
sirv
server. But the current config keeps creating new instances ofsirv
on each reload without properly stopping the previous ones. This PR fixes that behaviour.