Closed Jacknq closed 1 year ago
Currently .ico
format files are not supported as the input to the favicon plugin. Try replacing with png
, or svg
files and check whether it resolves the issue.
Also you do not need to add the the below line
<link rel="icon" href="[<%= BASE_URL %>favicon.ico](http://localhost:8080/%3C%=%20BASE_URL%20%%3Efavicon.ico)">
Remove it from the html file since the required html markup will be injected automatically. If you still have doubts, you can refer the demo project in the test folder(https://github.com/JohnPremKumar/vite-plugin-favicons-inject/tree/main/test)
hi,
I do have /favicon.ico
link in html, it seems base url
is generating vite with some issues, thats the reason I would use some plugin to see if that issue ll be resolved.
You need to remove the /favicon.ico
file and add your favicon in svg
or png
format like below:
// In vite.config.js file
plugins: [
vue( ),
vitePluginFaviconsInject('./src/logo.png'),
]
If you want to have a base url to be added. you can use the base
config provided by Vite like below instead of the above method:
// In vite.config.js file
{
.......
plugins: [
vue( ),
vitePluginFaviconsInject('./src/logo.png'),
],
base: "https:://www.example.com"
.......
}
Thanks, I dont use base option, since I want to be universal on base, should be all relative to root and resolved on web server automatically.
vite 4.0.4
//vite.config
//html
<link rel="icon" href="[<%= BASE_URL %>favicon.ico](http://localhost:8080/%3C%=%20BASE_URL%20%%3Efavicon.ico)">