gatsby-plugin-mdx doesn't find local plugins?
See original GitHub issueIs this expected? Known issue?
{
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [
`my-local-plugin`, // doesn't work
{
resolve: require.resolve('path-to-my-local-plugin') // works
}
]
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
gatsby-plugin-mdx
gatsby -plugin-mdx requires gatsby-source-filesystem to be present and configured to process local MDX files in order to generate the resulting Gatsby nodes ...
Read more >gatsby-plugin-mdx cannot find module 'gatsby/webpack'
I'm pretty new to gatsby, and most of the plugins added were from following their tutorials, so I'm really scratching my head here....
Read more >How to create a blog in Gatsby with MDX | by Brion Mario
In this post, I will go through the process of configuring a Gatsby application to be able to list out a blog index...
Read more >gatsby-plugin-mdx v4.3.0
Gatsby remark plugins. This config option is used for compatibility with a set of plugins many people use with remark that require the...
Read more >GatsbyJS - Transform Data to Use MDX - codersnack.com
To see a list of other transformer plugins, try searching for gatsby-transformer- in the Gatsby Plugin Library.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are lots of interconnected issues here. Especially if the
gatsby-plugin-mdx
is declared in theme and not in top-level gatsby-config:Note that the issues mostly talk about subplugins being npm packages, but it’s actually the same problem for local plugins
Exporting
resolvePlugin
alone wouldn’t be enough - there would also need to be some metadata of location ofgatsby-config
that declare given plugin to be able to resolve correctly (to use asrootDir
param of `resolvePlugin).On top of that, check this comment https://github.com/gatsbyjs/gatsby/pull/8379#issuecomment-585223189 about work on “selective cache invalidation” - for this to work Gatsby core will need to know about relationships between plugins/subplugins to properly clear caches and exporting
resolvePlugin
will “hide” this information from core, meaning that “selective cache invalidation” won’t have enough information to work properly.I’ll close this issue, because the problem is already captured in https://github.com/gatsbyjs/gatsby/issues/21592 and there’s no point in having duplicates.
The
resolvePlugin
option is also already mention there (as well as some limitation of this approach)