Skip to content

Conversation

@gkatrakazas
Copy link
Member

Use a VITE_BRANDING_HASH derived from the branding/ folder to version all branding-related assets (favicon, manifest, PWA icons, screenshots, OG image, logos), so branding changes are visible immediately without manual hard reloads.

Changes

  • Add getBrandingHash(brandingDir) and compute VITE_BRANDING_HASH in vite.config.ts.
  • Expose the hash as:
    • %VITE_BRANDING_HASH% (HTML)
    • import.meta.env.VITE_BRANDING_HASH (TS/JS/plugins)
  • Update index.html to append ?v=%VITE_BRANDING_HASH% to:
    • /favicon.ico
    • /icons/apple-touch-icon.png
    • /manifest.json
    • OG/Twitter image
  • Update BrandingManifestPlugin + manifest generation:
    • Add ?v=VITE_BRANDING_HASH to manifest icons[].src and screenshots[].src.
    • Add ?v=VITE_BRANDING_HASH to BRANDING_LOGO_LIGHT / BRANDING_LOGO_DARK env values.
  • Service worker:
    • Keep precacheAndRoute(self.__WB_MANIFEST) (no manual favicon/manifest entries).
    • On activate, call cleanupOutdatedCaches(), delete the images runtime cache, claim clients, and reload them.

@gkatrakazas gkatrakazas requested a review from a team as a code owner December 19, 2025 10:57
@gkatrakazas gkatrakazas force-pushed the feat/branding-hash-static-assets branch from 19deba0 to cc73eef Compare December 19, 2025 11:09
Copy link
Member

@smncd smncd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@gkatrakazas gkatrakazas merged commit eeb90ee into master Dec 19, 2025
5 checks passed
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.

4 participants