-
-
Notifications
You must be signed in to change notification settings - Fork 750
feat: support regexp and function of output.clean
#10207
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
Conversation
✅ Deploy Preview for rspack canceled.
|
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.
Pull Request Overview
This PR adds support for regular expressions and function callbacks in the clean options, addressing issue 7822. Key changes include removing legacy test files, updating type definitions and Zod schemas for clean options, and refactoring file system trimming logic to use a new KeepPattern abstraction.
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/webpack-test/configCases/clean/ignore-rx/test.filter.js | Removed legacy test file for regex-based clean ignore |
tests/webpack-test/configCases/clean/ignore-fn/test.filter.js | Removed legacy test file for function-based clean ignore |
packages/rspack/src/config/zod.ts | Updated the Zod schema to accept RegExp, string, or function for the clean.keep option |
packages/rspack/src/config/types.ts | Extended the Clean type to support RegExp and function values |
packages/rspack/etc/core.api.md | Updated API documentation for the Clean type |
crates/rspack_core/src/utils/fs_trim.rs | Refactored file system trimming to use a new KeepPattern enum for matching kept files/folders |
crates/rspack_core/src/options/clean_options.rs | Extended CleanOptions to include KeepRegex and KeepFunc variants and made keep() async |
crates/rspack_core/src/compiler/mod.rs | Updated clean file removal logic to handle new clean options asynchronously |
crates/node_binding/src/raw_options/raw_output.rs | Adjusted raw options conversion to leverage the updated CleanOptions |
crates/node_binding/src/clean_options.rs | Updated the N-API clean options to support string, RegExp, and function inputs |
Files not reviewed (2)
- website/docs/en/config/output.mdx: Language not supported
- website/docs/zh/config/output.mdx: Language not supported
CodSpeed Performance ReportMerging #10207 will not alter performanceComparing 🎉 Hooray!
|
Summary
close #7822
Checklist