Fix window is not defined error during build
__PATH_PREFIX__ is always defined now, so checking for __PREFIX_PATHS__ isn't necessary any more. This fixes `gatsby build` for this branch.
This commit is contained in:
parent
7cae968420
commit
a3028127b8
1 changed files with 1 additions and 8 deletions
|
|
@ -6,16 +6,9 @@ import { rhythm, scale } from '../utils/typography'
|
|||
class Template extends React.Component {
|
||||
render() {
|
||||
const { location, children } = this.props
|
||||
const rootPath = `${__PATH_PREFIX__}/`
|
||||
let header
|
||||
|
||||
let rootPath = `/`
|
||||
if (
|
||||
typeof window.__PREFIX_PATHS__ !== `undefined` &&
|
||||
window.__PREFIX_PATHS__
|
||||
) {
|
||||
rootPath = window.__PATH_PREFIX__ + `/`
|
||||
}
|
||||
|
||||
if (location.pathname === rootPath) {
|
||||
header = (
|
||||
<h1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue