ElMassimo / vite_ruby

⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
https://vite-ruby.netlify.app/
MIT License
1.32k stars 122 forks source link

Automatic refresh for SSR server #399

Closed sergey-pt closed 1 year ago

sergey-pt commented 1 year ago

Is your feature request related to a problem? Please describe. This feature request is not related to a problem

Describe the solution you'd like Currently it is possible to run bin/vite build --ssr --watch to build and watch for changes in files. But bin/vite ssr is not picking up newly generated build after the changes unless it will be manually restarted. It would be nice to have an opportunity to develop locally and have SSR enabled and watch for changes. Maybe it's already possible to run bin/vite ssr and watch for changed build?

Additional context @ElMassimo thank you so much for the amazing work that you are doing 🙏

ElMassimo commented 1 year ago

Hi Sergey!

Providing auto-restart for the node server is out of scope for this gem, as it would require a custom script to monitor build changes in order to restart the Node process that is running the server.

Moving this to a Discussion, so that folks can share their solutions on how to set up auto-restart for SSR in development.