implement keep_fargs for mangle (#5307)

closes #4657
This commit is contained in:
Alex Lam S.L
2022-01-20 21:13:26 +00:00
committed by GitHub
parent efed55f42d
commit e24b255350
20 changed files with 507 additions and 267 deletions

View File

@@ -115,6 +115,7 @@ a double dash to prevent input files being used as option arguments:
Equivalent to setting `ie: true` in `minify()`
for `compress`, `mangle` and `output` options.
By default UglifyJS will not try to be IE-proof.
--keep-fargs Do not mangle/drop function arguments.
--keep-fnames Do not mangle/drop function names. Useful for
code relying on Function.prototype.name.
--name-cache <file> File to hold mangled name mappings.
@@ -504,6 +505,9 @@ if (result.error) throw result.error;
- `ie` (default: `false`) — enable workarounds for Internet Explorer bugs.
- `keep_fargs` (default: `false`) — pass `true` to prevent discarding or mangling
of function arguments.
- `keep_fnames` (default: `false`) — pass `true` to prevent discarding or mangling
of function names. Useful for code relying on `Function.prototype.name`.
@@ -868,6 +872,9 @@ UglifyJS.minify(code, { mangle: { toplevel: true } }).code;
- `debug` (default: `false`) — Mangle names with the original name still present.
Pass an empty string `""` to enable, or a non-empty string to set the debug suffix.
- `keep_fargs` (default: `false`) — Use `true` to prevent mangling of function
arguments.
- `keep_quoted` (default: `false`) — Only mangle unquoted property names.
- `regex` (default: `null`) — Pass a RegExp literal to only mangle property