Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby): Support ESM-only gatsby-remark-* plugins #37440

Merged
merged 9 commits into from
Jan 11, 2023

Conversation

LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Jan 11, 2023

Description

When writing a local plugin (inside plugins)/using external plugin for gatsby-transformer-remark or remarkPlugins array of gatsby-plugin-mdx, this remark plugin didn't support being written in ESM.

This was due to no correct handling in the subPlugins validation. In addition to the resolve and options key of the plugin that a user might write in their gatsby-config, we're also adding module and modulePath to the object in the validation step. Previously, the module key was using require(). Now it uses await import.

Documentation

One expects it already works so no change needed.

Related Issues

[ch59936]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 11, 2023
@LekoArts LekoArts added topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 11, 2023
@LekoArts LekoArts changed the title fix(gatsby): Support ESM-only gatsby-remark-* plugins fix(gatsby): Support ESM-only gatsby-remark-* plugins Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants