Merge pull request #106 from gatsbyjs/m-allanson-patch-1
Fix `window is not defined` error during build
This commit is contained in:
commit
4a3683b9e2
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