diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-10-19 23:02:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-19 23:02:27 +0800 |
commit | 9f4b98f8e461dabf3a3c97c247d9c72f981aa28d (patch) | |
tree | 303f4ab3bf079d1e5cd3a66af37388d3896c2fe5 /README.md | |
parent | 0f2ef3367ce980f20cb4f72e8978aec5d1b8a8f2 (diff) | |
download | tracifyjs-9f4b98f8e461dabf3a3c97c247d9c72f981aa28d.tar.gz tracifyjs-9f4b98f8e461dabf3a3c97c247d9c72f981aa28d.zip |
backport #2374 (#2376)
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -515,7 +515,6 @@ if (result.error) throw result.error; ```javascript { - warnings: false, parse: { // parse options }, @@ -538,6 +537,7 @@ if (result.error) throw result.error; nameCache: null, // or specify a name cache object toplevel: false, ie8: false, + warnings: false, } ``` @@ -645,6 +645,10 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u 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 being compressed into `1/0`, which may cause performance issues on Chrome. @@ -709,6 +713,8 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u `foo === void 0`. Note: recommend to set this value to `false` for IE10 and earlier versions due to known issues. +- `unsafe` (default: `false`) -- apply "unsafe" transformations (discussion below) + - `unsafe_comps` (default: `false`) -- Reverse `<` and `<=` to `>` and `>=` to allow improved compression. This might be unsafe when an at least one of two operands is an object with computed values due the use of methods like `get`, @@ -716,8 +722,6 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u comparison are switching. Compression only works if both `comparisons` and `unsafe_comps` are both set to true. -- `unsafe` (default: `false`) -- apply "unsafe" transformations (discussion below) - - `unsafe_Func` (default: `false`) -- compress and mangle `Function(args, code)` when both `args` and `code` are string literals. @@ -738,15 +742,19 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u ## Mangle options +- `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. + 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 excluded from mangling. Example: `["foo", "bar"]`. - `toplevel` (default `false`). Pass `true` to mangle names declared in the top level scope. -- `eval` (default `false`). Pass `true` to mangle names visible in scopes - where `eval` or `with` are used. - Examples: ```javascript |