fix(napi/transform): fix define plugin not applying DCE correctly#14264
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the define plugin was incorrectly applying Dead Code Elimination (DCE) with overly aggressive settings, causing debugger statements to be removed when they shouldn't be.
- Changed DCE options from
smallest()todce()to preservedebuggerstatements - Added test coverage to verify
debuggerstatements are retained after define plugin transformation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc/src/compiler.rs | Updated DCE configuration from smallest() to dce() to fix aggressive removal |
| napi/transform/test/transform.test.ts | Added test case to verify debugger statements are preserved |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
…4264) DCE options was using "smallest", hence `debugger` was removed. fixes 14260
c69e31e to
013e053
Compare

DCE options was using "smallest", hence
debuggerwas removed.fixes #14260