From 5fd80aa5cfa7fcae5c96f23f634226f3caf2c496 Mon Sep 17 00:00:00 2001 From: JGameCreation Date: Mon, 14 Aug 2017 23:05:09 +0200 Subject: [PATCH] Fix bad character escape sequence in typography.js on Windows (#1801) --- packages/gatsby-plugin-typography/src/gatsby-node.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/gatsby-plugin-typography/src/gatsby-node.js b/packages/gatsby-plugin-typography/src/gatsby-node.js index 308eadda53d90..86f303775b375 100644 --- a/packages/gatsby-plugin-typography/src/gatsby-node.js +++ b/packages/gatsby-plugin-typography/src/gatsby-node.js @@ -1,5 +1,6 @@ const fs = require(`fs`) const path = require(`path`) +const os= require(`os`) // Write out a typography module to .cache. @@ -13,6 +14,9 @@ exports.sourceNodes = ({ store }, pluginOptions) => { program.directory, pluginOptions.pathToConfigModule )}")` + if(os.platform() == `win32`){ + module = module.split(`\\`).join(`\\\\`) + } } else { module = `const Typography = require("typography") const typography = new Typography()