Skip to content

Commit 96398fd

Browse files
DSchaugaearon
authored andcommitted
fix: attempt to fix windows issues with example code snippets (reactjs#1385)
This PR may (!?) fix the issue with windows support the GraphQL query not running. Will need to be validated by someone on Windows, but this _seems_ like it'll work.
1 parent 333656c commit 96398fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/gatsby-transformer-home-example-code/gatsby-node.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const crypto = require(`crypto`);
1+
const crypto = require('crypto');
2+
const path = require('path');
23

34
const createContentDigest = obj =>
45
crypto
@@ -14,7 +15,7 @@ exports.onCreateNode = async ({actions, node, loadNodeContent}) => {
1415

1516
if (
1617
sourceInstanceName === 'content' &&
17-
relativeDirectory === 'home/examples' &&
18+
relativeDirectory === path.join('home', 'examples') &&
1819
ext === '.js'
1920
) {
2021
const code = await loadNodeContent(node);

0 commit comments

Comments
 (0)