swc
swc copied to clipboard
ts type declaration of `minify.mangle` doesn't match runtime check
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 ofprops,topLevel,keepClassNames,keepFnNames,keepPrivateProps,ie8,safari10,reservedat 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