Chapter 12. Deploying Gatsby
In this chapter, we’ll start with a comprehensive introduction to how Gatsby handles environment variables, a subject we’ve touched on many times throughout this book but have not accorded its own full coverage. Then we’ll explore how to handle unusual hosting requirements such as assets hosted elsewhere and Gatsby sites located on paths other than domain roots. Finally, we’ll examine some of the most commonly used hosting infrastructure providers for Gatsby builds and deployments (Netlify, Vercel, Gatsby Cloud, and others), which each have independent and compelling advantages for developers working in their ecosystems.
Gatsby developers can use environment variables to provide values that need to be distinct across development environments. They are most commonly used to obfuscate certain information that may be sensitive and should not be exposed to others.
Some environments require different information ...