Skip to content

Commit

Permalink
wrap in production checks
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed Jul 9, 2020
1 parent ce17e25 commit 572e68a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/gatsby-link/src/index.js
Expand Up @@ -27,9 +27,17 @@ export function withPrefix(path, prefix = getGlobalBasePrefix()) {
// These global values are wrapped in typeof clauses to ensure the values exist.
// This is especially problematic in unit testing of this component.
const getGlobalPathPrefix = () =>
typeof __PATH_PREFIX__ !== `undefined` ? __PATH_PREFIX__ : undefined
process.env.NODE_ENV !== `production`
? typeof __PATH_PREFIX__ !== `undefined`
? __PATH_PREFIX__
: undefined
: __PATH_PREFIX__
const getGlobalBasePrefix = () =>
typeof __BASE_PATH__ !== `undefined` ? __BASE_PATH__ : undefined
process.env.NODE_ENV !== `production`
? typeof __BASE_PATH__ !== `undefined`
? __BASE_PATH__
: undefined
: __BASE_PATH__

const isLocalLink = path =>
path &&
Expand Down

0 comments on commit 572e68a

Please sign in to comment.