Chapter 13. Advanced Topics in Gatsby

In the previous chapters, we’ve examined some of the most important beginning and intermediate use cases when developing Gatsby sites. But there are also many features available in Gatsby for more advanced use cases. For example, as a Gatsby developer, you may wish to automate certain tasks during Gatsby site setup, customize the GraphQL schema emitted by Gatsby’s schema generation process, configure how Gatsby bundles sites, add components to Markdown files managed in Gatsby, or optimize your site’s performance beyond Gatsby’s defaults.

In this wide-ranging chapter, we’ll cover some advanced use cases and features that go well beyond Gatsby’s default capabilities that are available from starters. We’ll explore creating Gatsby recipes, an example of infrastructure as code (IaC); adding components to Markdown using the MDX library; customizing Gatsby’s GraphQL schema and bundling process; and optimizing performance using Gatsby’s cache layer and other techniques relevant to both development and production use cases.

Creating Recipes

In this section we’ll explore recipes in Gatsby, which are configuration files or scripts that Gatsby ingests to generate predefined and consistent environments across development and production with minimal overhead. We’ll also discuss the concept of IaC and how to automate common Gatsby site operations.

Infrastructure as Code

IaC involves the notion of managing discrete environments (such as development, testing, ...

Get Gatsby: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.