You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is my proposal, a new compress option unsafe_hoist_static_method_alias. In the compress phase, swc counts and replaces static built-in object methods with aliases:
Note that this optimization should only applied to built-in objects' known static methods (Object.assign, Reflect.apply, etc.). Also since it is possible for user code to override built-in objects' static methods, this option should be prefixed with unsafe and should not be enabled by default.
Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the feature
Given the following code:
Currently both terser and swc can only minified the code into
Here is my proposal, a new compress option
unsafe_hoist_static_method_alias
. In the compress phase, swc counts and replaces static built-in object methods with aliases:In the mangle phase, swc can mangle
__ObjectAssign
into a shorter name:Note that this optimization should only applied to built-in objects' known static methods (
Object.assign
,Reflect.apply
, etc.). Also since it is possible for user code to override built-in objects' static methods, this option should be prefixed withunsafe
and should not be enabled by default.Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: