vue cli怎么添加浏览器标签页图标

在build文件夹
找到webpack.dev.conf.js,再找到HtmlWebpackPlugin,添加favicon:‘favicon.ico路径’,

 

new HtmlWebpackPlugin({
  filename: 'index.html',
  template: 'index.html',
  favicon:'./nationalEmblem.png', //这里设置图标路径
  inject: true
}),

然后找到webpack.prod.conf.js,再找到HtmlWebpackPlugin,添加favicon:‘favicon.ico路径’

new HtmlWebpackPlugin({
      filename: config.build.index,
      template: 'index.html',
      favicon: './nationalEmblem.png', //这里设置图标路径
      inject: true,
      minify: {
        removeComments: true,
        collapseWhitespace: true,
        removeAttributeQuotes: true
        // more options:
        // https://github.com/kangax/html-minifier#options-quick-reference
      },

 

posted @ 2020-06-08 13:50  javahcke  阅读(906)  评论(0编辑  收藏  举报