Ensure base path is available in client app for including static assets at runtime

Created on 15 January 2025, 4 months ago

Overview

While working on ✨ [exploratory] PoC of Preact+Tailwind components editable via CodeMirror or Monaco Active we stumbled upon an issue with how the React app was trying to fetch a WASM file at runtime. It needed to know its own base public path to do that (e.g. /modules/contrib/experience_builder/ui). The solution for the POC was a script that sets that in the Vite config at build time. That solution is not only fragile, it won't work when we start distributing build artifacts.

Proposed resolution

Find a way to read base public path at runtime (e.g. after it's being passed in drupalSettings), or to include WASM files properly without any build time configuration.

πŸ“Œ 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