bluerobotics / cockpit

An intuitive and customizable cross-platform ground control station for remote vehicles of all types.
https://blueos.cloud/cockpit/docs
Other
72 stars 22 forks source link

Fix Hot Reload on Electron #1394

Closed rafaellehmkuhl closed 1 month ago

rafaellehmkuhl commented 1 month ago

This fixes the Hot Module Replacement functionality on Electron development.

https://github.com/user-attachments/assets/e5317586-3810-4e2a-ab50-c86cf37c1c76

This can be easily changed with the following: choose some component in the screen, like the Alerter.vue, and change its background color. You will see that before this patch it doesn't change live, and instead one needs to reload the vite server.

I originally planned to replace vite-plugin-electron with electron-vite, which is better maintained, better documented and simpler to use, but I got the former to work, so I think we can stick with it for a while and change it only if we find some wall.

rafaellehmkuhl commented 1 month ago

Converted to draft as its breaking the CI 🫠

rafaellehmkuhl commented 1 month ago

@ArturoManzoli everything is now working!