Vite: Expose host and hostname in the config, also add a setting for hot module reloading
What does this merge request do and why?
Add a new setting to enable / disable vite HMR
We are running E2E tests with the GDK. In those circumstances we do not need hot module reloading because the assets are not going to change after checkout. This will probably speed those tests up a little bit.
Properly reverse proxy vite through nginx
Apparently workhorse / rails are not able (or not configured) to proxy the websocket connection of vite. If Hot Module Reloading is enabled, we can just transparently proxy all requests directly from nginx to vite and this will enable HMR with vite behind nginx.
Set host, listen on right address and group hmr params
We need to set the host to the correct listen address in order to work in e.g. tailscale networks. Grouping the HMR bit into one options makes the whole thing easier to understand as well.
How to set up and validate locally
See the instructions in the corresponding GitLab MR
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.