In Gatsby Cloud, for our new version of Preview we need the user to have previewMode enabled when the user is on a preview and disabled when the user is on a production build. We need to have a mechanism to check if they're currently running in a preview or not. Rather than having the user be responsible for configuring this like so:
We want to be able to rollout the new changes without asking the users to have to take action and alter their gatsby-config file for the fix to work.
We will check to see if the GATSBY_IS_PREVIEW env variable is present, which means they're on Gatsby Cloud hosting, and then check its value to determine if we're looking at a preview or not.
In Gatsby Cloud, for our new version of Preview we need the user to have
previewMode
enabled when the user is on a preview and disabled when the user is on a production build. We need to have a mechanism to check if they're currently running in a preview or not. Rather than having the user be responsible for configuring this like so:We want to be able to rollout the new changes without asking the users to have to take action and alter their
gatsby-config
file for the fix to work.We will check to see if the
GATSBY_IS_PREVIEW
env variable is present, which means they're on Gatsby Cloud hosting, and then check its value to determine if we're looking at a preview or not.