-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gatsby-plugin-mdx): fix html field resolver to work with webpack@5 (
#30158) (#30172) Cherry-picked from 0a6c6eb Co-authored-by: Michal Piechowiak <[email protected]>
- Loading branch information
Showing
5 changed files
with
47 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
it(`generates content for html field correctly`, () => { | ||
cy.request("/html-queried-like-feed-plugin.json").should(response => { | ||
expect(response.body.data.mdx.html).to.include( | ||
`<p>Just to test html field used usually for rss feed generation` | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const fs = require(`fs-extra`) | ||
const path = require(`path`) | ||
|
||
exports.onPostBuild = async ({ graphql }) => { | ||
const results = await graphql(` | ||
{ | ||
mdx(slug: { eq: "html" }) { | ||
html | ||
} | ||
} | ||
`) | ||
|
||
await fs.outputJSON( | ||
path.join(__dirname, `public`, `html-queried-like-feed-plugin.json`), | ||
results, | ||
{ spaces: 2 } | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Message } from "theme-ui" | ||
|
||
Just to test html field used usually for rss feed generation. Please don't edit. | ||
|
||
<Example /> | ||
|
||
<Message data-testid="external">Just testing</Message> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters