refactor(packages/codegen): specify in TSDown plugin how many args to remove from call sites (#25970)
Alter how functions where are not used in no-sourcemap builds get removed from the build. Previously, the plugin explicitly replaced calls to these functions with `void 0`. Instead: 1\. Add `if (SOURCEMAPS)` guards to these functions, so minifier sees that they're no-ops and removes the calls. 2\. Remove arguments from their call sites, so nothing gets left over by minifier. Additionally, remove the params from the function declarations themselves. The table in plugin specifies how many arguments to remove for each function. These change does not alter the output code - the same stuff gets removed, just by a different mechanism. But this change enables the next PR #25971.
O
overlookmotel committed
4c650372cdd1e81e5501159e74dfe1e5037c7235
Parent: 7e2f193