GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.netlify.com — Gatsby on Netlify The new Netlify experience is here. Learn more or join the waitlist. Gatsby on NetlifyGatsby is a React-based, open source static site generator that pulls in data using a GraphQL API layer that can connect to a wide array of content sources. Key featuresSection titled “Key features”These Gatsby features provide key benefits for sites and apps, including ones built and deployed with Netlify.
Netlify integrationSection titled “Netlify integration”Choose your Gatsby version: When you trigger a build on Netlify for a site that uses Gatsby version 5.12.0 or later, Gatsby detects that you are using Netlify and automatically installs You can also choose to install the adapter yourself. Note that if your site already uses the Gatsby adapter for Netlify, you don't have to use the Essential Gatsby build plugin. Gatsby adapter for NetlifySection titled “Gatsby adapter for Netlify”The official Gatsby adapter for Netlify,
For more information on adapters, including information on how to create your own, visit Gatsby's documentation on adapters. Install the Gatsby adapter for NetlifySection titled “Install the Gatsby adapter for Netlify”Gatsby will automatically install If you want to further configure the adapter, you can add For more information, visit the LimitationsSection titled “Limitations”
Auto-generated Netlify FunctionsSection titled “Auto-generated Netlify Functions”To support Gatsby Functions and SSR/DSG render modes, the Gatsby adapter automatically generates Netlify Functions called Optional loading of the Gatsby datastore from the CDNBy default, Netlify includes the Gatsby datastore in the Netlify Function bundle, which is a deployment package that’s zipped for direct upload to AWS. If you have a larger site, the site’s datastore may exceed the maximum function deploy size, preventing you from successfully deploying your website.
Note that enabling loading the datastore from the CDN results in different page load behavior. On the first load of functions that handle SSR and DSG pages, the datastore is downloaded, which can result in a slower initial page load. During the build process, pre-warm requests are sent to the SSR and DSG function endpoints to reduce the user-facing impact of the datastore download. Local developmentWhen developing Gatsby Functions, you can use the built-in Suggested configuration valuesWhen you link a repository for a Gatsby project, Netlify provides a suggested build commandbuild commandThe instruction Netlify runs to prepare your site’s files before deploying them. and publish directorypublish directoryThe folder containing the finished files Netlify deploys after running your build command.: If you’re using the CLI to run Netlify Dev for a local development environment, Netlify suggests a dev command and port: You can override suggested values or set them in a configuration file instead, but suggested values from automatic framework detection may help simplify the process of setting up a Gatsby site on Netlify. For manual configuration, check out the typical build settings for Gatsby. Environment variablesEnvironment variablesEnvironment variablesNamed values stored outside your code that your site can read at build time or runtime. prefixed with Netlify Image CDNSection titled “Netlify Image CDN”Gatsby supports deferred image resizing with Netlify Image CDN. To enable the image CDN, you need to do the following:
For more information, including how to allow remote images, visit the Gatsby adapter for Netlify README. When you link a repository for a project, Netlify detects the framework your site is using. If you are using Gatsby version 5.11.0 or earlier, Netlify will automatically install the Essential Gatsby build plugin and provides suggested configuration values. For existing sites already linked to Netlify, you can choose to install the plugin yourself. Essential Gatsby build pluginSection titled “Essential Gatsby build plugin”The Essential Gatsby build plugin enables key functionality on sites that use Gatsby versions earlier than 5.12.0. It speeds up Netlify builds by preserving a site's Gatsby sites on Netlify need two plugins to support all features:
Install the Essential Gatsby build pluginSection titled “Install the Essential Gatsby build plugin”New Gatsby sites on Netlify automatically install the Essential Gatsby build plugin. You can confirm this in the build logs. If you want to install it manually, you can use file-based plugin installation and add the plugin as Install the Gatsby plugin for NetlifySection titled “Install the Gatsby plugin for Netlify”To enable SSR rendering, Gatsby redirects, and asset caching rules, you must also install the Gatsby plugin gatsby-plugin-netlify. To install the Gatsby plugin for Netlify, follow the Gatsby plugin process:
For more information, including optional plugin configuration, check out the LimitationsSection titled “Limitations”
Auto-generated Netlify FunctionsSection titled “Auto-generated Netlify Functions”To support Gatsby Functions and SSR/DSG render modes, the Essential Gatsby build plugin automatically generates Netlify Functions called You can use one or more of the following build environment variables to directly control generation of these functions.
Optional loading of the Gatsby datastore from the CDNBy default, Netlify includes the Gatsby datastore in the Netlify Function bundle, which is a deployment package that’s zipped for direct upload to AWS. If you have a larger site, the site’s datastore may exceed the maximum function deploy size, preventing you from successfully deploying your website.
Note that enabling loading the datastore from the CDN results in different page load behavior. On the first load of functions that handle SSR and DSG pages, the datastore is downloaded, which can result in a slower initial page load. During the build process, pre-warm requests are sent to the SSR and DSG function endpoints to reduce the user-facing impact of the datastore download. Local developmentWhen developing Gatsby Functions, you can use the built-in Suggested configuration valuesWhen you link a repository for a Gatsby project, Netlify provides a suggested build commandbuild commandThe instruction Netlify runs to prepare your site’s files before deploying them. and publish directorypublish directoryThe folder containing the finished files Netlify deploys after running your build command.: If you’re using the CLI to run Netlify Dev for a local development environment, Netlify suggests a dev command and port: You can override suggested values or set them in a configuration file instead, but suggested values from automatic framework detection may help simplify the process of setting up a Gatsby site on Netlify. For manual configuration, check out the typical build settings for Gatsby. Environment variablesEnvironment variablesEnvironment variablesNamed values stored outside your code that your site can read at build time or runtime. prefixed with Netlify Image CDNSection titled “Netlify Image CDN”Gatsby supports deferred image resizing with Netlify Image CDN. To enable the image CDN, you need to do the following:
For more information, including how to allow remote images, visit the Essential Gatsby build plugin's documentation. More resourcesSection titled “More resources”
Did you find this doc useful?Your feedback helps us improve our docs. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |