Skip to content

Commit a823463

Browse files
1-800-jonopieh
authored andcommitted
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`.
1 parent bfc2891 commit a823463

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/gatsby-plugin-mdx/loaders/mdx-scopes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function() {
1212
files
1313
.map(
1414
(file, i) =>
15-
`const scope_${i} = require('${slash(
15+
`var scope_${i} = require('${slash(
1616
path.join(abs, file)
1717
)}').default;`
1818
)

0 commit comments

Comments
 (0)