-
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): add context dependency to mdx-scopes loader #22121
Conversation
How do you trigger webpack not refreshing right now? (how to reproduce problem you are trying to fix) |
I have made a minimal repo for this bug(based on gatsby-starter-hello-world): |
Ok, the fix definitely fixes the issue with this reproduction. I do wonder if adding entire scope directory as dependency is correct here and whether it should be more nuanced. Not all scope files will need to be invalidated if any of scope files changes? I'll tag @johno for his mdx and webpack insights ;) |
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.
Ok, after brief investigation - the mdx-scopes
loader is used for "virtual" scopeContexts
import and it targets single "file", so I think this is correct and we should "rebuild" that virtual module if anything in scopes directory changes.
Thanks @csr632!
Holy buckets, @csr632 — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Description
Otherwise webpack will not rebuild when new scpoes is writed into cache. This can happen if you change mdx file when
gatsby develop
.Documentation
Related Issues