美文网首页
如何在一个vue-cli的项目中引入一个favicon.ico

如何在一个vue-cli的项目中引入一个favicon.ico

作者: 疯狂的蜗牛Dianna | 来源:发表于2020-05-20 17:49 被阅读0次

1.icon放在根目录下

2.在index。HTML 中引入 : <link rel="shortcut icon" type="image/x-icon href="favicon.ico">

3.开发阶段:

-build => webpack.dev.conf.js
-new HtmlWebpackPlugin({
        filename: 'index.html',
        template: 'index.html',
        inject: true,
        favicon: path.join('favicon.ico')   ==> 新加的
})

4.发布阶段

build => webpack.prod.conf.js
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
favicon: path.join('favicon.ico') ==> 新加的
});

相关文章

网友评论

      本文标题:如何在一个vue-cli的项目中引入一个favicon.ico

      本文链接:https://www.haomeiwen.com/subject/ojbnohtx.html