mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
241c559b83
This follows up on #24741 and addresses API feedback received after it was merged. ### Feature `mangleProps.include` and `mangleProps.exclude` now accept JavaScript `RegExp` values instead of strings. The binding copies the regular expression source and flags before async minification starts, then compiles the pattern once with Rust's regex engine. Native and WASI bindings expose the same API. The core Rust minifier API is unchanged. ### Example ```js mangleProps: { include: /^_/, exclude: /^__public/, } ``` ### Limitation Matching uses Rust regex syntax. The `i`, `m`, `s`, and `u` flags are supported. Unsupported JavaScript syntax or flags are returned as option errors. ### AI assistance OpenAI Codex was used for research, implementation, review, and testing. I reviewed and take responsibility for the changes.