wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.23k stars 1.18k forks source link

Place `favicon.ico` in the public dir by default #1979

Open sodic opened 4 months ago

sodic commented 4 months ago

Implement what Miho suggested here: https://github.com/wasp-lang/wasp/issues/1622#issuecomment-2016422324.

Instead of magically generating the default favicon.ico and telling users they can override it by placing their own in the public directory, we should just place the default one in the public directory. This change would:

What needs to be done:

infomiho commented 4 months ago

Some users wanted to use favicon.svg to set up their favicon, but our default favicon gets copied alongside theirs and overrules their svg favicon!

Having our favicon.ico in the public dir would prevent this from happening, although I'm not sure if users would need to setup their own meta tags in the head e.g. <link rel="shortcut icon" href="/favicon.ico" />

sodic commented 4 months ago

Both SVG and .ico are well-supported favicon formats. We should change Wasp to look for a file named favicon.ico|svg and template the head tag to use whatever it finds.

simasima121 commented 1 month ago

@infomiho Having this issue. How do I prevent your favicon from overwriting mine?

infomiho commented 1 month ago

You need to use a gavivon with ico extension 😃

simasima121 commented 1 month ago

You need to use a gavivon with ico extension 😃

Sorry I don't understand - what's gavivon?

sodic commented 1 month ago

@simasima121 He mean favicon :sweat_smile:

Make sure your favicon is called favicon.ico.

petebytes commented 1 month ago

Worked for me thanks was driving me mad trying to figure out why it was not updating. In my case I had a .png and on a macbook converted it as follows:

brew install imagemagick
magick favicon.png -define icon:auto-resize=16,32,48 favicon.ico
sodic commented 1 month ago

Thanks for sharing your process @petebytes. It might help someone in the future!