当前位置: 首页 > Web前端 > vue.js

Vue2.0项目favicon.ico不显示解决方法

时间:2023-03-31 17:39:18 vue.js

1。最好把favicon.ico放在index.html里面,放在同一个目录下2.在webpack配置文件里配置//在webpack.dev.conf.jsplugins里configurenewHtmlWebpackPlugin({filename:'index.html',template:'index.html',inject:true,favicon:'./favicon.ico'//addthisline}),在webpack.prod.conf中。js里面的plugins配置,否则favicon.iconewHtmlWebpackPlugin({filename:config.build.index,template:'index.html',inject:true,favicon:'./favicon.ico',//加上这个minify:{removeComments:true,collapseWhitespace:true,removeAttributeQuotes:true},chunksSortMode:'dependency'}),3.在index.html中引入代码4.修改配置文件后,最好运行npmrundev。如果这么小的图标还是显示不出来,最好清除一些缓存

猜你喜欢