Skip to content

Instantly share code, notes, and snippets.

@AndrewIngram
Created August 8, 2018 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewIngram/fa650bf0b5fdbcda884d18a76aea8270 to your computer and use it in GitHub Desktop.
Save AndrewIngram/fa650bf0b5fdbcda884d18a76aea8270 to your computer and use it in GitHub Desktop.
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