Skip to content

Commit

Permalink
fix(gatsby-transformer-remark): provide _rest_ of args to sub plugins
Browse files Browse the repository at this point in the history
Note: this injects a getCache helper (when available) that can be used
to get a cache instance
  • Loading branch information
DSchau committed Nov 26, 2018
1 parent e83fc0d commit 6a8c593
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/gatsby-transformer-remark/src/extend-node-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const withPathPrefix = (url, pathPrefix) =>
const ASTPromiseMap = new Map()

module.exports = (
{ type, store, pathPrefix, getNode, getNodesByType, cache, reporter },
{ type, pathPrefix, getNode, getNodesByType, cache, reporter, ...rest },
pluginOptions
) => {
if (type.name !== `MarkdownRemark`) {
Expand Down Expand Up @@ -133,6 +133,7 @@ module.exports = (
getNode,
reporter,
cache,
...rest,
},
plugin.pluginOptions
)
Expand Down Expand Up @@ -201,6 +202,7 @@ module.exports = (
pathPrefix,
reporter,
cache,
...rest,
},
plugin.pluginOptions
)
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-transformer-remark/src/on-node-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const crypto = require(`crypto`)
const _ = require(`lodash`)

module.exports = async function onCreateNode(
{ node, getNode, loadNodeContent, actions, createNodeId, reporter },
{ node, loadNodeContent, actions, createNodeId, reporter },
pluginOptions
) {
const { createNode, createParentChildLink } = actions
Expand Down

0 comments on commit 6a8c593

Please sign in to comment.