解决Vue项目中favicon图标无法正常显示方法

方法一:

  1.将favicon.ico文件存放到项目根路径下;

  2.配置webpack.dev.conf.js

    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
      favicon: path.resolve('favicon.ico'),
      inject: true
    })
 
 
方法二:

  1.将favicon.ico文件存放到static文件夹下;

  2.配置webpack.dev.conf.js

    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
      favicon:'static/favicon.ico',
      inject: true
    })
 
 
方法三:
  图片文件有缓存,清除缓存
posted @ 2019-05-17 15:31  强运可乐  阅读(3038)  评论(0编辑  收藏  举报