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

remove favicon.ico by default #108

Closed
prabirshrestha opened this issue Jul 22, 2016 · 14 comments
Closed

remove favicon.ico by default #108

prabirshrestha opened this issue Jul 22, 2016 · 14 comments

Comments

@prabirshrestha
Copy link

Angular starterkit uses the following code for favicon. https://github.com/angular/universal-starter/blob/master/src/index.html

  <link rel="icon" href="data:;base64,iVBORw0KGgo=">

It would be good if create-react-app did the same. favicon.ico can also be supported specially for those who want to have custom favicon files that they want to publish.

@gaearon
Copy link
Contributor

gaearon commented Jul 22, 2016

This sounds reasonable but we currently don't have a way to copy arbitrary files into the compiled folder. So favicon is treated "specially" and this is why we don't allow removing it.

If we remove it we would also need to introduce a way to add static assets outside the src directory. I think we'll have to do it anyway but it's a separate (existing) issue that warrants more discussion.

@mxstbr
Copy link
Contributor

mxstbr commented Jul 23, 2016

We could probably detect if a favicon.ico file exists from the webpack config and set the HTMLWebpackPlugin flag accordingly, which might be the nicest option. Then it works if you have a favicon.ico, but it also works if you don't have one?

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

If it didn't come bundled, how would you guess that putting favicon.ico in project root magically works? You would probably try to add a link tag yourself, and you would think that you can reference any other file like this (like custom iOS home icons). But surprisingly that won't work.

@mxstbr
Copy link
Contributor

mxstbr commented Jul 23, 2016

That's actually true, hmm…

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

I want to address this. But not as a separate feature. It should be solved at the same time with #28.

@lacker
Copy link
Contributor

lacker commented Jul 24, 2016

What's the downside of the status quo - you just don't like having a favicon.ico file around if you don't want a favicon for your project? It doesn't seem too bad to just use the default one in that case.

@ForbesLindesay
Copy link
Contributor

I would think most projects should have a favicon.ico file at their root. We could perhaps integrate with/recommend http://realfavicongenerator.net/ to people to make it easier for people to get set up with a decent favicon?

@gaearon
Copy link
Contributor

gaearon commented Jul 29, 2016

We probably won’t do this unless this is commonly requested. (It doesn’t seem to be so far.)

@andreypopp
Copy link
Contributor

Would be good if html-webpack-plugin could allow to require files from template:

<link rel="icon" require:href="./src/favicon.ico">

Or something like that.

@gaearon
Copy link
Contributor

gaearon commented Aug 12, 2016

Yea, this is pretty much how I’d like it to work. Is it definitely not supported? Maybe we’re just doing it some wrong way.

@andreypopp
Copy link
Contributor

Looking at the sources of html-webpack-plugin it seems it is not. Child compiler should be run in a loader instead and require:{href,src,...} — parsed and compiled to require(..) calls.

@andreypopp
Copy link
Contributor

There's html-loader which does a similar thing, wondering if it can be used along with html-webpack-plugin.

@gaearon
Copy link
Contributor

gaearon commented Aug 12, 2016

This is why I asked: I sort of assumed HtmlWebpackPlugin would use html-loader.

@gaearon
Copy link
Contributor

gaearon commented Aug 12, 2016

If you already have a template loader, you can use it to parse the template. Please note that this will also happen if you specifiy the html-loader and use .html file as template.

Worth trying?

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants