Skip to content

Commit 247a183

Browse files
authored
fix(gatsby-plugin-mdx): Pass node API helpers through mdx-loader to remark plugins (#21211)
* Pass node API helpers through mdx-loader * Fix parse error
1 parent 1060d72 commit 247a183

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/gatsby-plugin-mdx/gatsby/create-webpack-config.js

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module.exports = (
7575
loader: path.join(`gatsby-plugin-mdx`, `loaders`, `mdx-loader`),
7676
options: {
7777
cache: cache,
78+
actions: actions,
7879
...other,
7980
pluginOptions: options,
8081
},

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

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module.exports = async function(content) {
9797
cache,
9898
pathPrefix,
9999
pluginOptions,
100+
...helpers
100101
} = getOptions(this)
101102

102103
const options = withDefaultOptions(pluginOptions)
@@ -161,6 +162,7 @@ ${contentWithoutFrontmatter}`
161162
}
162163

163164
const { rawMDXOutput } = await genMdx({
165+
...helpers,
164166
isLoader: true,
165167
options,
166168
node: { ...mdxNode, rawBody: code },

0 commit comments

Comments
 (0)