1、修改webpack.dev.conf文件 webpack.prod.conf文件
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
// favicon: './favicon.ico'
favicon: path.resolve('favicon.ico'), //新增
}),
2、将ico放在根目录下
1、修改webpack.dev.conf文件 webpack.prod.conf文件
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
// favicon: './favicon.ico'
favicon: path.resolve('favicon.ico'), //新增
}),
2、将ico放在根目录下