diff --git a/gatsby-node.js b/gatsby-node.js index a9b002f1..875525fd 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -39,19 +39,6 @@ exports.onCreateNode = ({ node, getNode, actions }) => { exports.createPages = ({ graphql, actions }) => { const { createPage, createRedirect } = actions - // - // create redirects - // - redirects.forEach(({ from, to }) => { - createRedirect({ - fromPath: from, - redirectInBrowser: true, - toPath: to - }) - - console.log('Create redirect: ' + from + ' --> ' + to) - }) - return new Promise((resolve, reject) => { resolve( graphql( @@ -138,6 +125,19 @@ exports.createPages = ({ graphql, actions }) => { }) }) + // + // create redirects + // + redirects.forEach(({ from, to }) => { + createRedirect({ + fromPath: from, + redirectInBrowser: true, + toPath: to + }) + + console.log('Create redirect: ' + from + ' --> ' + to) + }) + resolve() }) )