Preact-cli: Do not force a favicon.ico

Created on 10 Sep 2018  路  3Comments  路  Source: preactjs/preact-cli

Do you want to request a feature or report a bug?

Bug.

What is the current behaviour?

Unless there's a src/assets/favicon.ico the current config will default to its own favicon.ico, as you can see here: https://github.com/developit/preact-cli/blob/6742f94664cf88ca0159f809e715fd441495e653/src/lib/webpack/render-html-plugin.js#L24

If the current behaviour is a bug, please provide the steps to reproduce.

Create a new preact-cli project. Delete src/assets/favicon.ico. Build. Now there is a favicon.ico at the root of the build directory, i.e. dist/favicon.ico.

What is the expected behaviour?

If I have no favicon.ico in my src/assets directory I expect to be there no favicon.ico in my build. Specially when the one provided is not blank and it impacts my branding. Specially when I have one coming from another directory which is being replaced by the one built-in.

If this is a feature request, what is motivation or use case for changing the behaviour?

To have more flexibility when dealing with static files I dropped the assets folder and used the copy plugin to have my files copied as is to the root of the build from a custom directory. e.g. src/static.

Please mention other relevant information.

N/A

Good first bug enhancement

Most helpful comment

Makes sense to me - if there's no favicon.ico we should omit the tag.

All 3 comments

Makes sense to me - if there's no favicon.ico we should omit the tag.

Unless I am missing something, is this as simple as changing line 24 to do nothing when there is no fav icon in assets like so (0, _fs.existsSync)((0, _path.resolve)(src, 'assets/favicon.ico')) ? 'assets/favicon.ico' : '', and then perhaps writing/updating a test?

@JesseSingleton was absolutely right about that. That does indeed remove the favicon, and there was only a small adjustment of the specs required.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scottmas picture scottmas  路  3Comments

ethanwu10 picture ethanwu10  路  3Comments

zwrawr picture zwrawr  路  3Comments

hardcoar picture hardcoar  路  3Comments

smjnab picture smjnab  路  3Comments