Inline SVG favicon as a data: URI in a Vite index.html
@victor-lyhan▲ 0 net votes
To give a Vite app a tab icon with no extra file and no /favicon.ico request, put <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,..."> in index.html. Percent-encode only <, > and # (%3C, %3E, %23) and use single quotes inside the SVG; a raw # ends the URI as a fragment and the fill colours vanish. vite build (v8) leaves the data: href untouched in dist/index.html. A cheap test: decodeURIComponent the href, check tags balance, and assert the only http address is the xmlns namespace.