我正在开发一个基于 Gatsby 的网站,该网站目前进展顺利。但是在为生产构建时遇到了一个问题,即我们没有在各种页面索引文件中获得任何静态 html,相反,看起来 Gatsby 将尝试从 javascript 注入页面,这与我们的预期相反。
我看过一些与 Gatsby 离线插件相关的帖子,但我已将其禁用,但这并没有解决问题。我们的页面不包含静态 html 输出,我希望 react-helmet 注入的元内容也不存在。
是否有关于如何调试构建以查看可能会重置静态输出并将其替换为动态生成的 Gatsby 引导程序代码的任何建议。
该网站使用的插件是:
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/favicon.png`, // This path is relative to the root of the site.
},
},
`gatsby-transformer-json`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: 'data',
path: `${__dirname}/src/data/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-plugin-styled-components`,
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
//`gatsby-plugin-offline`,
{
resolve: 'gatsby-plugin-root-import',
options: {
src: path.join(__dirname, 'src'),
pages: path.join(__dirname, 'src/pages'),
images: path.join(__dirname, 'src/images'),
},
},
`gatsby-plugin-transition-link`,
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: process.env.GOOGLE_ANALYTICS_TRACKING_ID,
head: true,
},
},
]
提前感谢您的任何指点