api sets修复
Suggested reading: Production GatsbyJS: Plugins
建议阅读: Production GatsbyJS:插件
有什么问题? (What’s the problem?)
Sometimes the GatsbyJS API files can get massive. gatbsy-node.js
can get big if there are a lot of page generation, gatsby-config.js
can get big when you're using a lot of plugins. Big files mean that it can be more difficult to diagnose problems with configuration.
有时GatsbyJS API文件可能会很大。 如果有大量页面生成,则gatbsy-node.js
会变大,当您使用大量插件时, gatsby-config.js
会变大。 大文件意味着诊断配置问题可能会更加困难。
为每个API文件创建一个文件夹 (Make a Folder for Each API File)
For example:
例如:
root/
| gatsby-config/
| | index.js
| | site-metadata.js
| | plugins.js
Converting each API file into a folder unlocks the possibility to make the API files more modular and manageable.
将每个API文件转换为文件夹可释放使API文件更具模块化和可管理性的可能性。
The Gatsby API allows for certain keys to be exported from the API files. For example, the gatsby-config API allows for the plugins
key to be exported.
Gatsby API允许从API文件中导出某些密钥。 例如,gatsby-config API允许