Skip to content

Commit

Permalink
Make routes module available to other modules
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Nov 3, 2016
1 parent 041bc7c commit 28e84f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/intermediate-representation-dir/production-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ runtime.install({
const rootElement = document.getElementById(`react-mount`)
const rootRoute = require(`./split-child-routes`)

// If you try to load the split-child-routes module in other
// modules, Webpack freezes in some sort of infinite loop when
// you try to build the javascript for production. No idea
// why... so for now we'll pop the routes on window. I hope no
// one feels overly dirty from reading this ;-)
if (typeof window !== 'undefined') {
window.gatsbyRootRoute = rootRoute
}

let currentLocation
browserHistory.listen(location => {
currentLocation = location
Expand Down

0 comments on commit 28e84f3

Please sign in to comment.