Closed binarykitchen closed 4 days ago
Rsbuild also provides html.appIcon for generating apple-touch-icon and web app manifest icons.
According to https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs, the icons currently provided by Rsbuild should fit most modern needs.
favicons-webpack-plugin provides too many icons, I think Rsbuild will not support all of them, we can select the necessary icons to support.
Thanks. That's a great post. Ok, agreed, we do not need too many favicons, but …
According to evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs, the icons currently provided by Rsbuild should fit most modern needs.
"... the icons currently provided by Rsbuild ..."
iconS ⇽- that's in plural, yet when I do a basic run in production mode, it generates one favicon only:
export default {
html: {
favicon: './src/assets/icon.png',
},
};
the icons currently provided by Rsbuild should fit most modern needs
Since it produces one favicon only, I wonder if it is a bug and whether I should configure them manually with the appIcon
option?
Yes, you should configure the appIcon
if you need the other icons.
Well, in that case, I'd have to manually generate each app favicon for each size. favicons-webpack-plugin
did that job for me, less work ... some automatic favicon generation might be good. What do you think?
Agreed, fair enough. Keep it lightweight.
I wonder if the existing FaviconsWebpackPlugin would be compatible to reuse inside rsbuild?
We cannot use favicons-webpack-plugin
in Rsbuild because it depends on HtmlWebpackPlugin
and Rsbuild does not use HtmlWebpackPlugin
.
See:
But I think it is possible to make favicons-webpack-plugin
be compatible with HtmlRspackPlugin
.
What problem does this feature solve?
It's me again. There is a neat webpack plugin which produces many different favicons, designed for all the different devices and phones. For example:
Link: https://github.com/jantimon/favicons-webpack-plugin
Upon build, it generates many different images and ultimately links them all in the final index HTML page. It works very well on iPhones and bookmarks among all different OS.
What does the proposed API look like?
Presently, you provide one favicon configuration: https://rsbuild.dev/config/html/favicon
It would be good to expand it further and have it produce various favicons for some common OS's and mobile phones by default. And have the theme colour configurable based on your design. Just an idea.