From 567f40d7973f25d554770d0138323f6dcfeb67c4 Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 20 Jul 2024 21:19:00 +0800 Subject: [PATCH] fix(bindings/types): Add missing mangle options (#9298) **Description:** Add missing mangle options to be consistent with the SWC documentation: https://swc.rs/docs/configuration/minification#jscminifymangle ![image](https://github.com/user-attachments/assets/34b12efd-d1e0-4ab0-a4e2-82419f66d8a6) --- packages/types/index.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/types/index.ts b/packages/types/index.ts index 08ee67a7a554..46b7fd0f2adf 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -302,12 +302,44 @@ export interface TerserCompressOptions { export interface TerserMangleOptions { props?: TerserManglePropertiesOptions; + /** + * Pass `true` to mangle names declared in the top level scope. + */ + topLevel?: boolean + + /** + * @deprecated An alias for compatibility with terser. + */ toplevel?: boolean; + /** + * Pass `true` to not mangle class names. + */ + keepClassNames?: boolean; + + /** + * @deprecated An alias for compatibility with terser. + */ keep_classnames?: boolean; + /** + * Pass `true` to not mangle function names. + */ + keepFnNames?: boolean; + + /** + * @deprecated An alias for compatibility with terser. + */ keep_fnames?: boolean; + /** + * Pass `true` to not mangle private props. + */ + keepPrivateProps?: boolean; + + /** + * @deprecated An alias for compatibility with terser. + */ keep_private_props?: boolean; ie8?: boolean;