You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a custom base path option to the Dockerfile. By specifying the BASE_PATH build argument when building the Dockerfile, the Vite build step will use this path as the root for all assets and generated bundles.
By default, the root will remain as /, which is the same as now. The only minor change is the assumption of Bash variables in the excalidraw-app/package.json's build:app:docker script, but because I assume it's mostly used for building with Docker, that's a safe assumption to make.
pwuersch
changed the title
feat: custom build path
feat: custom base path
Oct 1, 2025
Thanks for the PR! Just to understand this better, what is the use case to configure this?
We are deploying this application on a subpath like example.com/apps/excalidraw. For the frontend to load the assets accordingly, the Vite build step needs to be set to the correct URL. By default, this Excalidraw's Vite configuration assumes all the files are relative to the root /. This then breaks our use case because, e.g., our generated Excalidraw assets are actually located at example.com/apps/excalidraw/assets.
With this change, the BASE_PATH build arg can be set to (in our case) /apps/excalidraw during the container build, which adds this prefix to all resource URLs in places like the generated index.html. This way, the URLs end up as /apps/excalidraw/assets/….
This does not change the current behavior for anyone omitting the BASE_PATH container build argument because of its default value of /, which is in line with the Vite defaults used in this project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a custom base path option to the
Dockerfile. By specifying theBASE_PATHbuild argument when building theDockerfile, the Vite build step will use this path as the root for all assets and generated bundles.By default, the root will remain as
/, which is the same as now. The only minor change is the assumption of Bash variables in theexcalidraw-app/package.json'sbuild:app:dockerscript, but because I assume it's mostly used for building with Docker, that's a safe assumption to make.