Skip to content

Commit

Permalink
Account for both ES6/CommonJS modules
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Oct 8, 2016
1 parent 6dff735 commit 99b88fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/utils/query-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const writeChildRoutes = () => {
{
${pathStr}
component: (props) => {
const Component = require('${page.component}').default
let Component = require('${page.component}')
if (Component.default) {
Component = Component.default
}
const data = require('./json/${page.resultHash}.json')
return (
<Component {...props} {...data} />
Expand Down

0 comments on commit 99b88fd

Please sign in to comment.