Skip to content

Commit 089cfb2

Browse files
authored
Merge pull request #11536 from ethereum/gatsby-node-dirname-windows-bug
Add .replace(/\\./g, "/") to gatsby.node
2 parents 2d51226 + 45bde5d commit 089cfb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gatsby-node.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const commonRedirectProps = {
3838
* @returns boolean for if file is outdated or not
3939
*/
4040
const checkIsMdxOutdated = (filePath: string): boolean => {
41-
const dirname = path.resolve("./")
41+
// .replace(/\\/g, "/") to replace \ in windows paths ex: C:\\folder\\myfile.txt becomes C:/folder/myfile.txt
42+
const dirname = path.resolve("./").replace(/\\/g, "/")
4243
const splitPath = filePath.split(dirname)
4344
const tempSplitPath = splitPath[1]
4445
const tempSplit = tempSplitPath.split("/")

0 commit comments

Comments
 (0)