diff --git a/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js b/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js index 8ebdf47db45f7..7bb72c302a3a6 100644 --- a/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js +++ b/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js @@ -12,8 +12,8 @@ module.exports = () => { `const scope_${i} = require('${slash(path.join(abs, file))}').default;` ) .join("\n") + - `export default { - ${files.map((_, i) => "...scope_" + i).join(",\n")} -}` + `export default + Object.assign({}, ${files.map((_, i) => 'scope_' + i).join(',\n')} ) + ` ); };