Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Stop sirv before reloading rollup #213

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ranjan-purbey
Copy link

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 of sirv on each reload without properly stopping the previous ones. This PR fixes that behaviour.

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.
@antony
Copy link
Member

antony commented Feb 23, 2021

I'm not convinced that killing the process by spawning kill is the best way to go about this.

I've not noticed the template spinning up endless copies of sirv. that would indeed feel like an issue.

@ranjan-purbey
Copy link
Author

@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,
Copy link
Member

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

Copy link
Author

@ranjan-purbey ranjan-purbey Feb 23, 2021

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.

wlach added a commit to irydium/irydium that referenced this pull request Jan 9, 2022
* 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
wlach added a commit to irydium/irydium that referenced this pull request Jan 9, 2022
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not watch Rollup config file
3 participants