Closed tikhonbelousko closed 8 years ago
@PatrikLythell thanks cap! The idea is that I want to put favicon inside client folder, then require it in index.html. The last thing I came up with is to put the following loader for html:
{
test: /\.html$/,
loader: ExtractTextPlugin.extract('html?attrs=link:href')
},
The problem with this option is that every <link href="">
trying to require module.It's ok for <link rel="icon" type="image/png" href="./assets/favicon.png"/>
, but breaks when I try to use it with styles <link href='./styles.css' rel='stylesheet'/>
.
I'm doing this using the html-webpack-plugin
I've got something like this in my webpack config file:
plugins: [
...
new HtmlWebpackPlugin({
inject: true,
favicon: 'src/assets/favicon.ico',
template: 'src/index.html',
}),
@aziz the problem with html-webpack-plugin
is that as far as I know it's not possible to put 2 favicons. I need to put there 16x16 and 32x32 for retina monitors.
@DaZzz I use a favicon.ico that has embedded 16x16, 32x32 and 64x64 sized images inside.
@aziz :+1: I'll try it out. Do you have any suggestions where I can generate multi-size favicon?
I recommend http://www.xiconeditor.com
I can't figure out how to insert favicons into index.html. :confused: