vue项目webpack打包后找不见favorite.icon

解决办法:

1.将 .icon放在vue-cli脚手架生成的static文件夹下;

2.修改index.html页面中.ico的文件路径

< link rel= "shortcut icon" type= "image/x-icon" href= "static/logo.ico" rel= "external nofollow" />

3.修改webpack配置文件webpack.dev.conf.js文件,添加favicon:'static/logo.ico'

new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon:'static/logo.ico'
}),


你可能感兴趣的:(VUE)