Skip to content

fix(demo): use relative asset paths - #136

Merged
vitormattos merged 1 commit into
mainfrom
fix/demo-asset-base
Sep 28, 2026
Merged

vitormattos merged 1 commit into
mainfrom
fix/demo-asset-base

Conversation

@vitormattos

Copy link
Copy Markdown
Member

Summary

Fix the blank GitHub Pages demo by generating relative asset URLs for the demo build.

The deployed docs/index.html currently contains:

<script type="module" crossorigin src="/assets/index-Bv7bWBA1.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CfKTIpwI.css">

Because this repository is published as a GitHub Pages project site under /pdf-elements/, those absolute paths resolve against the organization site root:

https://libresign.github.io/assets/...

instead of:

https://libresign.github.io/pdf-elements/assets/...

This causes the JavaScript request to return HTML and be rejected due to its MIME type, while the CSS request returns 404.

Change

Set the Vite base to ./ only for --mode demo builds.

This makes the generated demo portable under the GitHub Pages project path without hard-coding /pdf-elements/, and leaves the library build and local development behavior unchanged.

@vitormattos
vitormattos requested a review from a team as a code owner September 28, 2026 15:12
@vitormattos
vitormattos merged commit c1f0678 into main Sep 28, 2026
5 of 6 checks passed
@vitormattos
vitormattos deleted the fix/demo-asset-base branch September 28, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant