From a82346365372f2bc213c41cc69ebae1665ae0d32 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 12 Jul 2019 07:45:44 -0300 Subject: [PATCH] fix(gatsby-plugin-mdx): Fix Safari 9 `const` syntax error (#15644) `SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.` Gatsby sites using mdx break in Safari 9 (possibly other older browsers) because it's using es6 `const`. --- packages/gatsby-plugin-mdx/loaders/mdx-scopes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js b/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js index d67ebf177fed3..0f873ce403209 100644 --- a/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js +++ b/packages/gatsby-plugin-mdx/loaders/mdx-scopes.js @@ -12,7 +12,7 @@ module.exports = function() { files .map( (file, i) => - `const scope_${i} = require('${slash( + `var scope_${i} = require('${slash( path.join(abs, file) )}').default;` )