1.在index.html中引入ico文件
<link rel="icon" href="./favicon.ico" type="image/x-icon">
2.在build/webpack.prod.conf.js中,粘如如下代码。
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
},
chunksSortMode: 'dependency'
}),
轻松搞定!