From 9440f7fe87e10d4e3b95168a06e7cb444d9d7ac8 Mon Sep 17 00:00:00 2001 From: zemnmez Date: Tue, 28 Jul 2020 16:49:16 +0100 Subject: [PATCH] fix issue where windows paths broke mdx.macro. see https://github.com/frontarm/mdx-util/issues/67 --- packages/mdx.macro/mdx.macro.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mdx.macro/mdx.macro.js b/packages/mdx.macro/mdx.macro.js index f350db8..7e61c00 100644 --- a/packages/mdx.macro/mdx.macro.js +++ b/packages/mdx.macro/mdx.macro.js @@ -120,7 +120,7 @@ function transform({ babel, filename, documentFilename }) { // changes will be picked up and cause a re-build. // Note: this relies on files with macros *not* being cached by babel. if (process.env.NODE_ENV === "development") { - imports += `import '${documentPath}'\n` + imports += `import '${documentPath.replace(/\\/g, "\\\\")}' // ${documentPath}\n` } let source = fs.readFileSync(documentPath, 'utf8');