Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function resolveSidebarPathOption(
async function readCategoriesMetadata(contentPath: string) {
const categoryFiles = await Globby('**/_category_.{json,yml,yaml}', {
cwd: contentPath,
ignore: ['**/node_modules/**'],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could fix your specific problem, but also introduce problems in other site setups. For example, sites can decide to load their mdx docs from npm and have actual content in node_modules. We need to ensure we keep supporting this pattern with tests, because I'm not sure what's the behavior of Globby.

And we also want to migrate to tinyglobby or eventually native Node globbing API, which may behave differently too. (#11042)

Maybe this will work better? Without any test, it's hard to tell:

ignore: [${contentPath}//node_modules/'],`

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node_modules will be present inside each of the packages. so passing contentPath is not possible.

});
const categoryToFile = _.groupBy(categoryFiles, path.dirname);
return combinePromises(
Expand Down
Loading