Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel renames favicon.ico #2474

Closed
1 of 3 tasks
joshuabambrick opened this issue Mar 1, 2021 · 7 comments
Closed
1 of 3 tasks

Parcel renames favicon.ico #2474

joshuabambrick opened this issue Mar 1, 2021 · 7 comments
Assignees

Comments

@joshuabambrick
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (below))

Notes:

I struggled for a while to understand why my favicon was not showing properly. It turns out I needed to add <link rel="icon" href="favicon.ico" type="image/x-icon"> to index.html but this did not seem obvious to me and the comment <!-- Place favicon.ico in the root directory --> was not very helpful (in fact, I interpreted it as that I only need to update favicon.ico and not add the above line).

@roblarsen
Copy link
Member

We do have it documented and you interpreted it correctly. Browsers pick up favicon.ico in the root of your site. Something else was going on with your icon.

https://github.com/h5bp/html5-boilerplate/blob/master/dist/doc/html.md#favicons-and-touch-icon

Favicons and Touch Icon
The shortcut icons should be put in the root directory of your site. favicon.ico is automatically picked up by browsers if it's placed in the root. HTML5 Boilerplate comes with a default set of icons (include favicon and one Apple Touch Icon) that you can use as a baseline to create your own.

read this post by @mathiasbynens for full details

rel="shortcut icon" considered harmful · Mathias Bynens

Also see #2243

@joshuabambrick
Copy link
Author

joshuabambrick commented Mar 1, 2021

I would ask you to double check this.

I understand that browsers pick it up in the root of the website, however, as I understand it, parcel (built in to h5bp) modifies the file name which means this no longer gets picked up. The file 'mysite/favico.ico' gave me a 404. Having added the above modification, desktop browsers picked up the new favicon, and I can see the file name as favicon.b30494fb.ico in my case.

I have not modified the parcel configuration at all nor renamed favicon.ico, so I don't think this was a problem on my end.

@roblarsen
Copy link
Member

roblarsen commented Mar 1, 2021

I don't need to double check the basic behavior or the way we implement favicons. The commit removing <link rel="shortcut icon" href="/favicon.ico"> is almost ten years old and Mathias' post is even older. So, what you're describing is not an issue with the documentation, but instead a configuration issue with Parcel, which we do provide as a convenience. We would not suggest adding <link rel="icon" href="favicon.ico" type="image/x-icon"> back into the HTML. What we will do is ensure Parcel doesn't cache-bust the favicon.

@roblarsen roblarsen reopened this Mar 1, 2021
@roblarsen roblarsen changed the title Document favicon usage Parcel renames favicon.ico Mar 1, 2021
@roblarsen roblarsen self-assigned this Mar 1, 2021
@joshuabambrick
Copy link
Author

Great, I think that would be very helpful.

@coliff
Copy link
Member

coliff commented Mar 3, 2021

I find the cache-busting filenames in Parcel to be quite frustrating too.
Perhaps a plugin like this: https://github.com/elwin013/parcel-plugin-static-files-copy is needed?

@vltansky
Copy link
Member

vltansky commented Mar 3, 2021

Maybe we should migrate to Vite instead?
Vite also has something similar to create-html5-boilerplate https://github.com/vitejs/vite/tree/main/packages/create-app

roblarsen added a commit that referenced this issue Nov 17, 2021
Closes #2487 and #2474

This is just a development server at this point. It hot reloads HTML JS and CSS.  That's enough for me. I'm open to contrary opinions.
roblarsen added a commit that referenced this issue Nov 30, 2021
* Proposal: Let's Replace Parcel With Webpack

Closes #2487 and #2474

This is just a development server at this point. It hot reloads HTML JS and CSS.  That's enough for me. I'm open to contrary opinions.

* Updates based on @coliff review

* wip

* fix merge conflict

* removing comment

* Final tweaks to docs
@roblarsen
Copy link
Member

Parcel is dead. Long live WebPack, apparently.

We do need to make sure that things like this don't happen going forward, so thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants