Skip to content

Accept string[] for expandDirectories #103

@benmccann

Description

@benmccann

If you define an Array it will only glob files that matches the patterns inside the Array

Needed to migrate Docusaurus:

https://github.com/facebook/docusaurus/blob/37d8844506d066a2bb07a5b19ccc4cfd39b6385c/packages/docusaurus/src/commands/writeHeadingIds.ts#L53

I don't think globs in files are explicitly supported: https://docusaurus.io/docs/cli#docusaurus-write-heading-ids-sitedir

I guess getPathsToWatch could return a directory rather than a file or glob though they don't give any examples of that being done.

https://github.com/facebook/docusaurus/blob/dae29a27825f75aaa2d08843360da0684f8282ec/website/versioned_docs/version-2.x/api/plugin-methods/extend-infrastructure.mdx#getpathstowatch-getpathstowatch

I think though that it would be rather hard to try to accomplish this by modifying the input patterns because we don't necessarily know what is a file and what is a directory. It's possible this could only be done either with the option in tinyglobby or possibly by requiring different input from users as a breaking change in Docusaurus v4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions