第一步:
在index.html中引入代碼:
<link type="image/x-icon" href="./favicon.ico" rel="shortcut icon external nofollow"/>
第二步:
在build/webpack.dev.conf.js中進行文件配置
new HtmlWebpackPlugin({ filename: 'index.html', template: 'index.html', inject: true, favicon:'./favicon.ico'//新增 }),
第三步:重新npm run dev,手動清緩存
最終效果: