diff options
author | Mihai Bazon <mihai@bazon.net> | 2013-03-13 09:44:06 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2013-03-13 09:44:06 +0200 |
commit | 9b1a40dfc3681ce6410afd6fbae1e72bd34f0901 (patch) | |
tree | 4e5a7324fcbf9ba076c6ee836e83f3333b1f3a55 /README.md | |
parent | e4b078cff73ae82114a6c5e7c2ae67cda63cd356 (diff) | |
download | tracifyjs-9b1a40dfc3681ce6410afd6fbae1e72bd34f0901.tar.gz tracifyjs-9b1a40dfc3681ce6410afd6fbae1e72bd34f0901.zip |
Support mangling toplevel names
Close #127
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -141,12 +141,19 @@ input files from the command line. ## Mangler options -To enable the mangler you need to pass `--mangle` (`-m`). Optionally you -can pass `-m sort=true` (we'll possibly have other flags in the future) in order -to assign shorter names to most frequently used variables. This saves a few -hundred bytes on jQuery before gzip, but the output is _bigger_ after gzip -(and seems to happen for other libraries I tried it on) therefore it's not -enabled by default. +To enable the mangler you need to pass `--mangle` (`-m`). The following +(comma-separated) options are supported: + +- `sort` — to assign shorter names to most frequently used variables. This + saves a few hundred bytes on jQuery before gzip, but the output is + _bigger_ after gzip (and seems to happen for other libraries I tried it + on) therefore it's not enabled by default. + +- `toplevel` — mangle names declared in the toplevel scope (disabled by + default). + +- `eval` — mangle names visible in scopes where `eval` or `when` are used + (disabled by default). When mangling is enabled but you want to prevent certain names from being mangled, you can declare those names with `--reserved` (`-r`) — pass a |