1.icon放在根目录下
2.在index。HTML 中引入 : <link rel="shortcut icon" type="image/x-icon href="favicon.ico">
3.开发阶段:
-build => webpack.dev.conf.js
-new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon: path.join('favicon.ico') ==> 新加的
})
4.发布阶段
build => webpack.prod.conf.js
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
favicon: path.join('favicon.ico') ==> 新加的
});
网友评论