aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-07-05 19:20:33 +0800
committerGitHub <noreply@github.com>2017-07-05 19:20:33 +0800
commit1ac25fc032096459f2966236c99c0f21da2787f3 (patch)
treeb6c9df9427997761a7b7bc148c552ddba3ee5059 /README.md
parent5f046c724bf0910e6ee7c1c3feabaf62625fa1c6 (diff)
downloadtracifyjs-1ac25fc032096459f2966236c99c0f21da2787f3.tar.gz
tracifyjs-1ac25fc032096459f2966236c99c0f21da2787f3.zip
improve `compress` granularity through `typeofs` (#2201)
fixes #2198
Diffstat (limited to 'README.md')
-rw-r--r--README.md7
1 files changed, 5 insertions, 2 deletions
diff --git a/README.md b/README.md
index 671d7136..fd142f4b 100644
--- a/README.md
+++ b/README.md
@@ -644,6 +644,10 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
- `booleans` -- various optimizations for boolean context, for example `!!a
? b : c → a ? b : c`
+- `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.
+
- `loops` -- optimizations for `do`, `while` and `for` loops when we can
statically determine the condition
@@ -873,7 +877,6 @@ when this flag is on:
- `new Object()` → `{}`
- `String(exp)` or `exp.toString()` → `"" + exp`
- `new Object/RegExp/Function/Error/Array (...)` → we discard the `new`
-- `typeof foo == "undefined"` → `foo === void 0`
- `void 0` → `undefined` (if there is a variable named "undefined" in
scope; we do it because the variable name will be mangled, typically
reduced to a single character)
@@ -1050,5 +1053,5 @@ uglifyjs file.js -m
```
To enable fast minify mode with the API use:
```js
-UglifyJS.minify(code, { compress: false, mangle: true });
+UglifyJS.minify(code, { compress: false, mangle: true });
```