Skip to content

[Feature]: watchOptions.ignored support (string | RegExp)[] type #10596

@9aoy

Description

@9aoy

What problem does this feature solve?

As a framework developer, I would like to add some extra watchOptions.ignored configuration. If the original watchOptions.ignored is a RegExp, I cannot make the user configuration and my configuration work at the same time, because rspack does not support the (string | RegExp)[] type

https://rspack.rs/config/watch#watchoptionsignored

User's configuration:

export default {
  //...
  watchOptions: {
    ignored: /\.git/,
  },
};

After merged configuration:

export default {
  //...
  watchOptions: {
    ignored: [/\.git/,  '**/dist'],
  },
};

What does the proposed API of configuration look like?

watchOptions.ignored support (string | RegExp)[] type.

- type ignored = RegExp | string | string[];
+ type ignored = RegExp | string | (string | RegExp)[];

Metadata

Metadata

Assignees

Labels

PR welcometeamThe issue/pr is created by the member of Rspack.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions