Skip to content

Inline logo as base64 in single-file HTML build#9

Merged
Tiryoh merged 2 commits intomainfrom
inline-logo-singlefile
Mar 25, 2026
Merged

Inline logo as base64 in single-file HTML build#9
Tiryoh merged 2 commits intomainfrom
inline-logo-singlefile

Conversation

@Tiryoh
Copy link
Copy Markdown
Owner

@Tiryoh Tiryoh commented Mar 24, 2026

Summary

  • Import logo.png via Vite asset pipeline (src/assets/) instead of referencing from public/
  • Set assetsInlineLimit: 500000 in singlefile config so the ~300KB logo gets base64-inlined
  • Normal build continues to output logo as a separate hashed file (dist/assets/logo-*.png)
  • Add vite-env.d.ts for Vite asset import type definitions

Test plan

  • npm run build — logo is a separate file in dist/assets/, not inlined
  • npm run build:singlefiledist-singlefile/index.html contains data:image/png;base64
  • Open both builds in browser and verify logo displays correctly
image

🤖 Generated with Claude Code

Import logo.png via Vite asset pipeline so it gets base64-inlined in the
singlefile build (assetsInlineLimit: 500000) while remaining a separate
hashed file in the normal build.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 24, 2026

Test Results

42 tests  ±0   42 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 5117adf. ± Comparison against base commit 884ed9a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 24, 2026

The public/logo.png was unnecessarily copied to dist-singlefile/
since the logo is already inlined via src/assets/ import.
Setting publicDir: false ensures only index.html is output.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@Tiryoh Tiryoh merged commit fbdd49b into main Mar 25, 2026
8 checks passed
@Tiryoh Tiryoh deleted the inline-logo-singlefile branch March 25, 2026 17:33
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