Change favicon Vuejs?

DenisMasot picture DenisMasot · Nov 8, 2018 · Viewed 12.5k times · Source

How to change favicon on Vuejs CLI ?

<link rel="shortcut icon" type="image/png" href="/src/assets/img/logo.png"/>

Answer

tony19 picture tony19 · Nov 9, 2018

Vue CLI (3.0.5) generates projects with the <root>/public directory containing the favicon.ico and index.html (which references the favicon.ico).

It seems you have your icon in <root>/src/assets. I recommend moving it to <root>/public, replacing favicon.ico with jinane-logo-JC.png, and updating index.html accordingly:

<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> --> <!-- REPLACE THIS -->
<link rel="icon" href="<%= BASE_URL %>jinane-logo-JC.png">