-
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): allow not defining entry for subplugins #33900
Conversation
2f65b85
to
7763051
Compare
1dd141e
to
93cfcfa
Compare
@@ -0,0 +1,4 @@ | |||
{ | |||
"name": "gatsby-plugin-child-with-main", | |||
"main": "lib/index.js" |
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.
test case setup for issue described in #33677
try { | ||
const resolvedPlugin = resolvePlugin(value, rootDir) | ||
const modulePath = require.resolve( | ||
`${resolvedPlugin.resolve}${entry ? `/${entry}` : ``}` |
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.
main fix - allow falsy/undefined entry
modulePath: expect.stringMatching( | ||
/gatsby-plugin-child-with-main[/\\]lib[/\\]index\.js$/ | ||
), |
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.
asserting that main
field from package.json
is used (lib/index.js
)
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.
Awesome 🎉
(cherry picked from commit f87164f)
Nice, this is great thanks! Is this scheduled for release in |
Yes! If a PR is in the "Release Hotfixes" project it'll be released as a patch for that version soonish. |
|
|
I still have an issue as described here. |
Description
This fixes cases when
gatsby-remark-*
subplugins havemain
field pointing to something else than<root>/index
module.Related Issues
[ch40936]
closes #33677