aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-29 16:53:48 +0800
committerGitHub <noreply@github.com>2019-10-29 16:53:48 +0800
commitbad664c6322538f1a5eec7f76dc44f81fa05c9e0 (patch)
treec8bb72ced239cd86cdb36f2efdf668f7df8a56df /README.md
parent8a191c0a8486bfd2a51562f0c072e00507abea6e (diff)
downloadtracifyjs-bad664c6322538f1a5eec7f76dc44f81fa05c9e0.tar.gz
tracifyjs-bad664c6322538f1a5eec7f76dc44f81fa05c9e0.zip
compress object literals (#3546)
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 21 insertions, 19 deletions
diff --git a/README.md b/README.md
index 270f20cb..f686889d 100644
--- a/README.md
+++ b/README.md
@@ -478,42 +478,42 @@ if (result.error) throw result.error;
## Minify options
-- `warnings` (default `false`) — pass `true` to return compressor warnings
- in `result.warnings`. Use the value `"verbose"` for more detailed warnings.
-
-- `parse` (default `{}`) — pass an object if you wish to specify some
- additional [parse options](#parse-options).
-
- `compress` (default `{}`) — pass `false` to skip compressing entirely.
Pass an object to specify custom [compress options](#compress-options).
+- `ie8` (default `false`) -- set to `true` to support IE8.
+
+- `keep_fnames` (default: `false`) -- pass `true` to prevent discarding or mangling
+ of function names. Useful for code relying on `Function.prototype.name`.
+
- `mangle` (default `true`) — pass `false` to skip mangling names, or pass
an object to specify [mangle options](#mangle-options) (see below).
- `mangle.properties` (default `false`) — a subcategory of the mangle option.
Pass an object to specify custom [mangle property options](#mangle-properties-options).
+- `nameCache` (default `null`) -- pass an empty object `{}` or a previously
+ used `nameCache` object if you wish to cache mangled variable and
+ property names across multiple invocations of `minify()`. Note: this is
+ a read/write property. `minify()` will read the name cache state of this
+ object and update it during minification so that it may be
+ reused or externally persisted by the user.
+
- `output` (default `null`) — pass an object if you wish to specify
additional [output options](#output-options). The defaults are optimized
for best compression.
-- `sourceMap` (default `false`) - pass an object if you wish to specify
+- `parse` (default `{}`) — pass an object if you wish to specify some
+ additional [parse options](#parse-options).
+
+- `sourceMap` (default `false`) -- pass an object if you wish to specify
[source map options](#source-map-options).
-- `toplevel` (default `false`) - set to `true` if you wish to enable top level
+- `toplevel` (default `false`) -- set to `true` if you wish to enable top level
variable and function name mangling and to drop unused variables and functions.
-- `nameCache` (default `null`) - pass an empty object `{}` or a previously
- used `nameCache` object if you wish to cache mangled variable and
- property names across multiple invocations of `minify()`. Note: this is
- a read/write property. `minify()` will read the name cache state of this
- object and update it during minification so that it may be
- reused or externally persisted by the user.
-
-- `ie8` (default `false`) - set to `true` to support IE8.
-
-- `keep_fnames` (default: `false`) - pass `true` to prevent discarding or mangling
- of function names. Useful for code relying on `Function.prototype.name`.
+- `warnings` (default `false`) — pass `true` to return compressor warnings
+ in `result.warnings`. Use the value `"verbose"` for more detailed warnings.
## Minify options structure
@@ -682,6 +682,8 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
where the return value is discarded, to avoid the parens that the
code generator would insert.
+- `objects` (default: `true`) -- compact duplicate keys in object literals.
+
- `passes` (default: `1`) -- The maximum number of times to run compress.
In some cases more than one pass leads to further compressed code. Keep in
mind more passes will take more time.