Skip to content

Commit

Permalink
fix(gatsby-plugin-gatsby-cloud): Emit CREATE_FILE_NODE in onPostBoots…
Browse files Browse the repository at this point in the history
…trap (#33136)
  • Loading branch information
sidharthachatterjee committed Sep 10, 2021
1 parent 709271e commit 62683f5
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions packages/gatsby-plugin-gatsby-cloud/src/gatsby-node.js
Expand Up @@ -92,20 +92,6 @@ exports.onPostBuild = async (
console.error(e)
}

/**
* Emit via IPC absolute paths to files that should be stored
*/

const fileNodes = getNodesByType(`File`)

// TODO: This is missing the cacheLocations .cache/caches + .cache/caches-lmdb
let fileNodesEmitted
for (const file of fileNodes) {
fileNodesEmitted = emitFileNodes({
path: file.absolutePath,
})
}

let rewrites = []
if (pluginOptions.generateMatchPathRewrites) {
const matchPathsFile = joinPath(
Expand All @@ -125,7 +111,6 @@ exports.onPostBuild = async (
}

await Promise.all([
fileNodesEmitted,
buildHeadersProgram(pluginData, pluginOptions),
createSiteConfig(pluginData, pluginOptions),
createRedirects(pluginData, redirects, rewrites),
Expand Down Expand Up @@ -168,3 +153,19 @@ const pluginOptionsSchema = function ({ Joi }) {
}

exports.pluginOptionsSchema = pluginOptionsSchema

exports.onPostBootstrap = async ({ getNodesByType }) => {
/**
* Emit via IPC absolute paths to files that should be stored
*/
const fileNodes = getNodesByType(`File`)

// TODO: This is missing the cacheLocations .cache/caches + .cache/caches-lmdb
let fileNodesEmitted
for (const file of fileNodes) {
fileNodesEmitted = emitFileNodes({
path: file.absolutePath,
})
}
await fileNodesEmitted
}

0 comments on commit 62683f5

Please sign in to comment.