const fs = require("fs");
const path = require("path");

module.exports = () => {
  const files = fs.readdirSync("./.cache/gatsby-mdx/mdx-scopes-dir");
  const abs = path.resolve("./.cache/gatsby-mdx/mdx-scopes-dir");
  return (
    files
      .map(
        (file, i) =>
          `const scope_${i} = require('${path.join(abs, file)}').default;`
      )
      .join("\n") +
    `export default {
  ${files.map((_, i) => "...scope_" + i).join(",\n")}
}`
  );
};

@@ -48,16 +48,48 @@
 %22path%22);
+%0Aconst slash = require(%22slash%22);
 %0A%0Amodule
@@ -338,16 +338,22 @@
 uire('$%7B
+slash(
 path.joi
@@ -364,16 +364,17 @@
 s, file)
+)
 %7D').defa

Correct path separators on Windows (#246)