How to add favicon to /dist?
See original GitHub issueSeems trivial but is difficult. How to add a favicon.ico
to the npm run build
task?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Add Favicon with React and Webpack - Stack Overflow
I am attempting to add a favicon to a React-based website that I made using webpack. It has been a total nightmare to...
Read more >How do I get favicon working with webpack - Help Requests
I put the same favicon.ico in two different places to try to get this to work and still it is not displayed when...
Read more >How to Favicon in 2022: Six files that fit most needs
Use copy-webpack-plugin to copy favicon.ico without adding a hash to file name. Bonus tip: create a separate icon for staging. Favicons are a ......
Read more >favicons-webpack-plugin - npm
Start using favicons-webpack-plugin in your project by running `npm i favicons-webpack-plugin`. ... Install. npm i favicons-webpack-plugin ...
Read more >Bundle your favicons with Webpack | Tech-Angels publications
The Good Ol' Days of just having a tiny favicon.ico are gone. Generate your favicon files with Real Favicon Generator and bundle them...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I only needed this:
In webpack.config.*.js files
Hmm that is one way. Here’s how I did it in case anyone lands on this thread:
require my favicon in my main App.js entry file
require('../assets/images/favicon.ico')
Added a loader configuration that does not scramble the image file names in the
build
task (per this thread https://github.com/webpack/webpack/issues/1336#issuecomment-171363119)Add the standard
<link rel="shortcut icon" href="favicon.ico">
in src/index.htmlNow
npm run build
will output the image/assets names as their original name, hence giving you the ability tohref="favicon.ico"
right in your index.html