diff --git a/gatsby-browser.js b/gatsby-browser.js index 6408214f06..7cdde155b7 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,2 +1,4 @@ /* eslint-env node */ require('./src/styles/global.css') + +export { wrapPageElement } from './gatsby-shared' diff --git a/gatsby-shared.tsx b/gatsby-shared.tsx new file mode 100644 index 0000000000..3558a61fd7 --- /dev/null +++ b/gatsby-shared.tsx @@ -0,0 +1,18 @@ +import { GatsbyBrowser, Script } from 'gatsby' + +const GATSBY_REO_DEV_CLIENT_ID = process.env.GATSBY_REO_DEV_CLIENT_ID + +export const wrapPageElement: GatsbyBrowser['wrapPageElement'] = ({ + element +}) => { + return ( + <> + {element} + {GATSBY_REO_DEV_CLIENT_ID && ( + + )} + + ) +} diff --git a/gatsby-ssr.js b/gatsby-ssr.js new file mode 100644 index 0000000000..0a79a1d16a --- /dev/null +++ b/gatsby-ssr.js @@ -0,0 +1 @@ +export { wrapPageElement } from './gatsby-shared' diff --git a/tsconfig.json b/tsconfig.json index da3042eecc..f413f2f38c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,7 @@ "include": [ "node_modules/@dvcorg/gatsby-theme-iterative", "./src/**/*", - "./*.js" + "./*.js", + "./*.tsx" ] }