我想使用 lib react-static-plugin-favicons显示一个网站图标。
我将它添加到我的 static.config.js :
export default {
entry: path.join(__dirname, 'src', 'index.tsx'),
getRoutes: async () => {
return [
{
path: '/',
template: 'src/containers/individuals.tsx'
}
]
},
plugins: [
require.resolve("react-static-plugin-sass"),
['react-static-plugin-typescript', { typeCheck: true }],
[
require.resolve('react-static-plugin-source-filesystem'),
{
location: path.resolve('./src/page'),
},
],
require.resolve('react-static-plugin-reach-router'),
require.resolve('react-static-plugin-sitemap'),
[
'react-static-plugin-favicons',
{ inputFile: path.resolve('./src/assets', 'favicon-32px.png') },
]
],
basePath: basepath,
Document: ({
Html,
Head,
Body,
children,
state: { siteData, renderMeta },
}) => (
<Html lang="en-US">
<Head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Head>
<Body>{children}</Body>
</Html>
),
}
你能发现我做错了什么,因为它不起作用吗?谢谢