angular/angular-cli

Replace favicon.ico in favor of png in src/assets

Open

#11.275 aperta il 17 giu 2018

Vedi su GitHub
 (9 commenti) (8 reazioni) (0 assegnatari)TypeScript (11.999 fork)batch import
area: @schematics/angularfeaturefeature: insufficient voteshelp wanted

Metriche repository

Star
 (26.585 star)
Metriche merge PR
 (Merge medio 1g 18h) (135 PR mergiate in 30 g)

Descrizione

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Area

- [ ] devkit
- [x] schematics

Desired functionality

favicon.ico is outdated and obsolete relic from the 90s. Browsers for the past 2decades have supported png favicons. Additionally, while it's fairly easy now to generate a favicon.ico, it's just not needed or used anymore.

There's no reason imo to include favicon.ico, even for "compatibility". Removing the favicon.ico will also remove the entries needed in angular.json and remove the only asset stored outside of src/assets.

It should be replaced in favor of modern favicon methods. PWAs should use manifest.json

  <link rel=icon href="assets/favicon-16x16.png" sizes="16x16" type="image/png">
  <link rel=icon href="assets/favicon-32x32.png" sizes="32x32" type="image/png">
  <link rel=icon href="assets/favicon.svg" sizes="any" type="image/svg+xml"> 

Note: svg doesn't have full browser support.

We haven't needed favicon.ico in years, but it's still widely used and implemented, even though all browsers support modern methods.

Guida contributor