This plugins provides favicons support for Vite.
In contrast to other plugins it adds hashes to all images based on the source file and places them under /assets
,
while keeping all manifest files under the root.
npm i vite-plugin-hashed-favicons
pnpm add vite-plugin-hashed-favicons
In your vite.config.ts
:
import favicons from "vite-plugin-hashed-favicons";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
favicons("./src/assets/favicon.svg", {
// See "favicons" package configuration
}),
],
});