Created
August 8, 2018 18:04
-
-
Save AndrewIngram/fa650bf0b5fdbcda884d18a76aea8270 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const { createFileNode } = require(`gatsby-source-filesystem/create-file-node`); | |
async function createLocaleFileNode(filePath, createNode, createNodeId) { | |
// HACKITY HACK HACK | |
const fileNode = await createFileNode( | |
path.resolve(__dirname, filePath), | |
createNodeId | |
); | |
createNode(fileNode, { | |
name: `gatsby-source-filesystem`, | |
}); | |
return fileNode; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment