Skip to content

Commit

Permalink
fix wording and formatting (#2512)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed Nov 25, 2017
1 parent 3b28b91 commit 97c464d
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions README.md
Expand Up @@ -598,25 +598,25 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u

## Compress options

- `booleans` (default: `true`) -- various optimizations for boolean context, for example `!!a
? b : c → a ? b : c`
- `booleans` (default: `true`) -- various optimizations for boolean context,
for example `!!a ? b : c → a ? b : c`

- `cascade` (default: `true`) -- small optimization for sequences, transform `x, x` into `x`
and `x = something(), x` into `x = something()`
- `cascade` (default: `true`) -- small optimization for sequences, transform
`x, x` into `x` and `x = something(), x` into `x = something()`

- `collapse_vars` (default: `true`) -- Collapse single-use non-constant variables - side
effects permitting.
- `collapse_vars` (default: `true`) -- Collapse single-use non-constant variables,
side effects permitting.

- `comparisons` (default: `true`) -- apply certain optimizations to binary nodes, for example:
`!(a <= b) → a > b` (only when `unsafe_comps`), attempts to negate binary
- `comparisons` (default: `true`) -- apply certain optimizations to binary nodes,
e.g. `!(a <= b) → a > b` (only when `unsafe_comps`), attempts to negate binary
nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc.

- `conditionals` (default: `true`) -- apply optimizations for `if`-s and conditional
expressions

- `dead_code` (default: `true`) -- remove unreachable code

- `drop_console` (default: `false`) -- default `false`. Pass `true` to discard calls to
- `drop_console` (default: `false`) -- Pass `true` to discard calls to
`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.
Expand All @@ -625,7 +625,7 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u

- `evaluate` (default: `true`) -- attempt to evaluate constant expressions

- `expression` (default: `false`) -- default `false`. Pass `true` to preserve completion values
- `expression` (default: `false`) -- Pass `true` to preserve completion values
from terminal statements without `return`, e.g. in bookmarklets.

- `global_defs` (default: `{}`) -- see [conditional compilation](#conditional-compilation)
Expand All @@ -647,19 +647,18 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u

- `join_vars` (default: `true`) -- join consecutive `var` statements

- `keep_fargs` (default: `true`) -- default `true`. Prevents the
compressor from discarding unused function arguments. You need this
for code which relies on `Function.length`.
- `keep_fargs` (default: `true`) -- Prevents the compressor from discarding unused
function arguments. You need this for code which relies on `Function.length`.

- `keep_fnames` (default: `false`) -- Pass `true` to prevent the
compressor from discarding function names. Useful for code relying on
`Function.prototype.name`. See also: the `keep_fnames` [mangle option](#mangle).

- `keep_infinity` (default: `false`) -- default `false`. Pass `true` to prevent `Infinity` from
- `keep_infinity` (default: `false`) -- Pass `true` to prevent `Infinity` from
being compressed into `1/0`, which may cause performance issues on Chrome.

- `loops` (default: `true`) -- optimizations for `do`, `while` and `for` loops when we can
statically determine the condition
- `loops` (default: `true`) -- optimizations for `do`, `while` and `for` loops
when we can statically determine the condition.

- `negate_iife` (default: `true`) -- negate "Immediately-Called Function Expressions"
where the return value is discarded, to avoid the parens that the
Expand Down Expand Up @@ -707,21 +706,22 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
occasions the default sequences limit leads to very slow compress times in which
case a value of `20` or less is recommended.

- `side_effects` (default: `true`) -- default `true`. Pass `false` to disable potentially dropping
- `side_effects` (default: `true`) -- Pass `false` to disable potentially dropping
functions marked as "pure". A function call is marked as "pure" if a comment
annotation `/*@__PURE__*/` or `/*#__PURE__*/` immediately precedes the call. For
example: `/*@__PURE__*/foo();`

- `switches` (default: `true`) -- de-duplicate and remove unreachable `switch` branches

- `toplevel` (default: `false`) -- drop unreferenced functions (`"funcs"`) and/or variables (`"vars"`)
in the top level scope (`false` by default, `true` to drop both unreferenced
functions and variables)
- `toplevel` (default: `false`) -- drop unreferenced functions (`"funcs"`) and/or
variables (`"vars"`) in the top level scope (`false` by default, `true` to drop
both unreferenced functions and variables)

- `top_retain` (default: `null`) -- prevent specific toplevel functions and variables from `unused`
removal (can be array, comma-separated, RegExp or function. Implies `toplevel`)
- `top_retain` (default: `null`) -- prevent specific toplevel functions and
variables from `unused` removal (can be array, comma-separated, RegExp or
function. Implies `toplevel`)

- `typeofs` (default: `true`) -- default `true`. Transforms `typeof foo == "undefined"` into
- `typeofs` (default: `true`) -- Transforms `typeof foo == "undefined"` into
`foo === void 0`. Note: recommend to set this value to `false` for IE10 and
earlier versions due to known issues.

Expand All @@ -746,25 +746,25 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
- `unsafe_regexp` (default: `false`) -- enable substitutions of variables with
`RegExp` values the same way as if they are constants.

- `unused` (default: `true`) -- drop unreferenced functions and variables (simple direct variable
assignments do not count as references unless set to `"keep_assign"`)
- `unused` (default: `true`) -- drop unreferenced functions and variables (simple
direct variable assignments do not count as references unless set to `"keep_assign"`)

- `warnings` (default: `false`) -- display warnings when dropping unreachable code or unused
declarations etc.
- `warnings` (default: `false`) -- display warnings when dropping unreachable
code or unused declarations etc.

## Mangle options

- `eval` (default `false`). Pass `true` to mangle names visible in scopes
- `eval` (default `false`) -- Pass `true` to mangle names visible in scopes
where `eval` or `with` are used.

- `keep_fnames` (default `false`). Pass `true` to not mangle function names.
- `keep_fnames` (default `false`) -- Pass `true` to not mangle function names.
Useful for code relying on `Function.prototype.name`. See also: the `keep_fnames`
[compress option](#compress-options).

- `reserved` (default `[]`). Pass an array of identifiers that should be
- `reserved` (default `[]`) -- Pass an array of identifiers that should be
excluded from mangling. Example: `["foo", "bar"]`.

- `toplevel` (default `false`). Pass `true` to mangle names declared in the
- `toplevel` (default `false`) -- Pass `true` to mangle names declared in the
top level scope.

Examples:
Expand Down

0 comments on commit 97c464d

Please sign in to comment.