From 66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 1 Oct 2026 16:34:55 -0700 Subject: The standalone wallet opened from a disk shows its avatars, font and languages. With no files beside it, relative punks/, locales/, nip46.js and jsqr.js looked on the disk. From file:// they now come from v3.coinos.io (images and scripts need no CORS; /locales/ now sends Access-Control-Allow-Origin on the server), and standalone.html carries Public Sans inline. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VP5Ljqk7EYcm5QQAbzDwog --- build.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'build.js') diff --git a/build.js b/build.js index 848ce92..1fdd889 100644 --- a/build.js +++ b/build.js @@ -397,12 +397,18 @@ ${pwa && !NO_SW ? SW_REGISTER + '\n' : ''} } // Self-contained single file (dev server, test tools, save-and-open-offline). -export async function buildHtml({ minify = true, pwa = minify, features = process.env.HAL_FEATURES, staging = isStaging() } = {}) { +export async function buildHtml({ minify = true, pwa = minify, features = process.env.HAL_FEATURES, staging = isStaging(), inlineFonts = false } = {}) { const outputs = await bundleApp({ minify, features, staging }); let js = await outputs[0].text(); // Guard against a literal inside the bundle closing our tag early. js = js.replaceAll('${js}` }); return html.replaceAll('{{COMMIT}}', gitCommit()); } @@ -453,7 +459,7 @@ if (import.meta.main) { // included), no PWA plumbing — meant to be downloaded from /standalone.html // and opened straight from a disk. Network features still reach out when // online; the wallet itself needs no server. - await Bun.write('dist/standalone.html', await buildHtml({ minify: true, pwa: false })); + await Bun.write('dist/standalone.html', await buildHtml({ minify: true, pwa: false, inlineFonts: true })); // Lazy-loaded QR decoder — kept out of index.html, fetched only when a // browser without BarcodeDetector opens the scanner. -- cgit v1.2.3