vue.js中怎么添加favicon图标


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

new HtmlWebpackPlugin({

filename: config.build.index,

template: 'index.html',

inject: true,

favicon: path.resolve('favicon.ico'), //新增

minify: {

emoveComments: true,

collapseWhitespace: true,

removeAttributeQuotes: true

...

}),

方法三 :vue项目打包后favicon无法正常显示

解决方法:

在webpack.prod.config.js中的HtmlWebpackPlugin插件选项中配置favicon选项,其中favicon的路径是个相对路径

1

2

3

4

5

6

new HtmlWebpackPlugin({

filename: 'index.html',

template: 'index.html',

favicon: 'src/assets/img/favicon.ico',

inject: true

}),

修改配置文件后需重启npm run dev

打包后根目录下就会有favicon.ico

相关免费学习推荐:JavaScript(视频)

以上就是vue.js中怎么添加favicon图标的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

vue.js与react.js区别是什么

微信小程序能不能用vue.js

vue.js怎么引入img

vue.js能做app吗

vue.js怎么加载js插件

vue.js怎样刷新组件

vue.js中如何写注释

vue.js刷新404找不到页面怎么办

深入浅析with的使用

vue.js怎么请求数据

更多相关阅读请进入《vue.js》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...