Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/gatsby-plugin-gatsby-cloud/src/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ const ShadowPortal = ({ children, identifier }) => {
)
}

export const wrapRootElement = ({ element }) => {
if (process.env.GATSBY_PREVIEW_INDICATOR_ENABLED === `true`) {
export const wrapRootElement = ({ element }, pluginOptions) => {
if (
process.env.GATSBY_PREVIEW_INDICATOR_ENABLED === `true` &&
!pluginOptions?.disablePreviewUI
) {
return (
<>
{element}
Expand Down
3 changes: 3 additions & 0 deletions packages/gatsby-plugin-gatsby-cloud/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ const pluginOptionsSchema = function ({ Joi }) {
generateMatchPathRewrites: Joi.boolean().description(
`When set to false, turns off automatic creation of redirect rules for client only paths`
),
disablePreviewUI: Joi.boolean().description(
`When set to true, turns off Gatsby Preview if enabled`
),
})
}

Expand Down