webpack - 所以我尝试在我的 gatsby-config.js 文件中添加 gatsby-plugin-favicon
问题描述
首先,我在 gatsby-config.js 文件中添加 gatsby-plugin-favicon,代码如下:
module.exports = {
siteMetadata: {
title: 'Chatbiz Blog',
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-catch-links',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
},
},
'gatsby-transformer-remark',
{
resolve: 'gatsby-plugin-favicon',
options: {
logo: "./src/images/icon.png",
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
twitter: false,
yandex: false,
windows: false
}
}
}
],
}
完成添加 gatsby-plugin-favicon 后,出现这样的错误
WebpackError: ENOENT: no such file or directory, open 'C:\Users\setia\myrep ository\GatsbyJS\gatsby_crash_course\public\.iconstats.json'
所以问题是我该如何解决这个问题?
解决方案
转到gatsby-config.js文件并删除下面提到的依赖项
icon: `src/images/gatsby-icon.png`,
推荐阅读
- jquery - HTML 验证消息未显示
- c - 如何释放指针数组?
- php - php如何在输出中回显字符串并格式化数字
- oracle - 如何在 oracle XMLTable 的 xpath 中将外部函数作为变量传递
- android - 无法使用模块编译项目
- ruby-on-rails - Has_many 通过 :association 未在 Rails 5.2 中注册
- azure - Azure Cloud Shell 陷入实例化
- flutter - 文本小部件未显示在 ListTile 颤动中
- android - 无法解决:firebase-auth-15.0.0
- highcharts - 在 highcharts 上查找特殊图表