F6: HTML export icon fetch respects BASE_URL

fetchIconAsBase64 fetched '/icon.svg', which 404s on subdirectory
deploys even though Vite is configured with base: './'. It now resolves
the icon against import.meta.env.BASE_URL like database.js already does
for the wasm file. Subdirectory deploys should be spot-checked with
npm run preview under a subpath.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David 2026-07-09 15:24:41 +02:00
parent 1a3f294b31
commit f324ffb2cb

View file

@ -98,7 +98,8 @@ function renderSessionItemsHtml(log) {
async function fetchIconAsBase64() { async function fetchIconAsBase64() {
try { try {
const res = await fetch('/icon.svg') // Resolve against BASE_URL so subdirectory deploys (base: './') still find the icon
const res = await fetch(import.meta.env.BASE_URL + 'icon.svg')
if (!res.ok) return null if (!res.ok) return null
const text = await res.text() const text = await res.text()
const bytes = new TextEncoder().encode(text) const bytes = new TextEncoder().encode(text)