-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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-plugin-mdx): fix html field resolver to work with webpack@5 #30158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an e2e test that uses the html field so we can make sure this doesn't break again?
None of our e2e tests use mdx so I would need to do full setup or add it to |
@pieh we have two that do. mdx and mdx-less-babel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding that!
Published in |
Description
html
field in gatsby-plugin-mdx was not working due its usage of webpack and not migrating it to work withwebpack@5
:asset.source()
was just not working anymore, because it was alreadySizeOnlySource
that we can only grab size stats from (ref https://webpack.js.org/blog/2020-10-10-webpack-5-release/#sizeonlysource-after-emit )node
externals preset resulted in various module likestream
orutil
not being availableThis changes how it currently work to straight import produced file (similar as we do in core for ssr rendering) and skip messing with compilation object to grab source and then materialize/evaluate it (and using additional webpack plugin just for that)
Related Issues
Fixes #29983