Support the `VITE_SERVER_ORIGIN` environment variable in the `xb_vite` module

Created on 5 November 2024, 3 months ago

Overview

The Experience Builder Vite Integration (xb_vite) module alters the xb-ui library to replace the built assets with what is being generated by Vite's dev server when npm run drupaldev is running, making hot module replacement (HMR) possible.

Currently the URL for Vite's dev server is hardcoded to its default protocol, hostname, and port β€” http://localhost:5173. This works in most cases, but not necessarily when someone would like to do npm run drupaldev from inside a container, such as one provided by DDEV or Lando, or develop using GitHub Codespaces or similar environments.

Proposed resolution

The XB React app's Vite config already reads an environment variable named VITE_SERVER_ORIGIN when setting server.origin. We can repurpose this variable and adjust how the xb_vite module includes assets from Vite's dev server.

πŸ“Œ Task
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024