swc icon indicating copy to clipboard operation
swc copied to clipboard

ts type declaration of `minify.mangle` doesn't match runtime check

Open troy351 opened this issue 3 years ago • 0 comments

Describe the bug

https://github.com/swc-project/swc/blob/eab1113450f818a109299e2b632a238cc8f77f60/node-swc/src/types.ts#L350-L366

use {mangle: {top_level: false}} will throw error

failed to parse options

Caused by: unknown field top_level, expected one of props, topLevel, keepClassNames, keepFnNames, keepPrivateProps, ie8, safari10, reserved at line 1 column 194

FYI. I used swc-wasm, and I noticed there is minify.toplevel which works

Input code

No response

Config

No response

Playground link

No response

Expected behavior

type declaration align with runtime check

Actual behavior

No response

Version

1.2.245

Additional context

No response

troy351 avatar Sep 02 '22 02:09 troy351