update docs for pure_funcs & drop_console (#1503)
closes #1362 closes #1399
This commit is contained in:
17
README.md
17
README.md
@@ -87,10 +87,9 @@ The available options are:
|
|||||||
-b, --beautify Beautify output/specify output options.
|
-b, --beautify Beautify output/specify output options.
|
||||||
-m, --mangle Mangle names/pass mangler options.
|
-m, --mangle Mangle names/pass mangler options.
|
||||||
-r, --reserved Reserved names to exclude from mangling.
|
-r, --reserved Reserved names to exclude from mangling.
|
||||||
-c, --compress Enable compressor/pass compressor options. Pass
|
-c, --compress Enable compressor/pass compressor options, e.g.
|
||||||
options like -c
|
`-c 'if_return=false,pure_funcs=["Math.pow","console.log"]'`
|
||||||
hoist_vars=false,if_return=false. Use -c with
|
Use `-c` with no argument to enable default compression
|
||||||
no argument to use the default compression
|
|
||||||
options.
|
options.
|
||||||
-d, --define Global definitions
|
-d, --define Global definitions
|
||||||
-e, --enclose Embed everything in a big function, with a
|
-e, --enclose Embed everything in a big function, with a
|
||||||
@@ -151,8 +150,10 @@ The available options are:
|
|||||||
them explicitly on the command line.
|
them explicitly on the command line.
|
||||||
--mangle-regex Only mangle property names matching the regex
|
--mangle-regex Only mangle property names matching the regex
|
||||||
--name-cache File to hold mangled names mappings
|
--name-cache File to hold mangled names mappings
|
||||||
--pure-funcs List of functions that can be safely removed if
|
--pure-funcs Functions that can be safely removed if their
|
||||||
their return value is not used [array]
|
return value is not used, e.g.
|
||||||
|
`--pure-funcs Math.floor console.info`
|
||||||
|
(requires `--compress`)
|
||||||
```
|
```
|
||||||
|
|
||||||
Specify `--output` (`-o`) to declare the output file. Otherwise the output
|
Specify `--output` (`-o`) to declare the output file. Otherwise the output
|
||||||
@@ -415,7 +416,9 @@ to set `true`; it's effectively a shortcut for `foo=true`).
|
|||||||
overhead (compression will be slower).
|
overhead (compression will be slower).
|
||||||
|
|
||||||
- `drop_console` -- default `false`. Pass `true` to discard calls to
|
- `drop_console` -- default `false`. Pass `true` to discard calls to
|
||||||
`console.*` functions.
|
`console.*` functions. If you wish to drop a specific function call
|
||||||
|
such as `console.info` and/or retain side effects from function arguments
|
||||||
|
after dropping the function call then use `pure_funcs` instead.
|
||||||
|
|
||||||
- `keep_fargs` -- default `true`. Prevents the
|
- `keep_fargs` -- default `true`. Prevents the
|
||||||
compressor from discarding unused function arguments. You need this
|
compressor from discarding unused function arguments. You need this
|
||||||
|
|||||||
Reference in New Issue
Block a user