diff options
author | Rob Garrison <wowmotty@gmail.com> | 2017-05-16 22:54:46 -0500 |
---|---|---|
committer | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-17 11:54:46 +0800 |
commit | baef8bf050fd8b4e733e11301912b61470fe61f3 (patch) | |
tree | 139993328908b80d8962028f2f927190ad47bf03 /README.md | |
parent | 0813c5316fabef4808c541499e47646973efe88c (diff) | |
download | tracifyjs-baef8bf050fd8b4e733e11301912b61470fe61f3.tar.gz tracifyjs-baef8bf050fd8b4e733e11301912b61470fe61f3.zip |
update output options in readme (#1958)
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 49 |
1 files changed, 28 insertions, 21 deletions
@@ -606,36 +606,33 @@ The code generator tries to output shortest code possible by default. In case you want beautified output, pass `--beautify` (`-b`). Optionally you can pass additional arguments that control the code output: +- `ascii_only` (default `false`) -- escape Unicode characters in strings and + regexps (affects directives with non-ascii characters becoming invalid) - `beautify` (default `true`) -- whether to actually beautify the output. Passing `-b` will set this to true, but you might need to pass `-b` even when you want to generate minified code, in order to specify additional arguments, so you can use `-b beautify=false` to override it. +- `bracketize` (default `false`) -- always insert brackets in `if`, `for`, + `do`, `while` or `with` statements, even if their body is a single + statement. +- `comments` (default `false`) -- pass `true` or `"all"` to preserve all + comments, `"some"` to preserve some comments, a regular expression string + (e.g. `/^!/`) or a function. - `indent_level` (default 4) - `indent_start` (default 0) -- prefix all lines by that many spaces -- `quote_keys` (default `false`) -- pass `true` to quote all keys in literal - objects -- `space_colon` (default `true`) -- insert a space after the colon signs -- `ascii_only` (default `false`) -- escape Unicode characters in strings and - regexps (affects directives with non-ascii characters becoming invalid) - `inline_script` (default `false`) -- escape the slash in occurrences of `</script` in strings -- `width` (default 80) -- only takes effect when beautification is on, this - specifies an (orientative) line width that the beautifier will try to - obey. It refers to the width of the line text (excluding indentation). - It doesn't work very well currently, but it does make the code generated - by UglifyJS more readable. -- `max_line_len` (default 32000) -- maximum line length (for uglified code) -- `bracketize` (default `false`) -- always insert brackets in `if`, `for`, - `do`, `while` or `with` statements, even if their body is a single - statement. -- `semicolons` (default `true`) -- separate statements with semicolons. If - you pass `false` then whenever possible we will use a newline instead of a - semicolon, leading to more readable output of uglified code (size before - gzip could be smaller; size after gzip insignificantly larger). +- `keep_quoted_props` (default `false`) -- when turned on, prevents stripping + quotes from property names in object literals. +- `max_line_len` (default `false`) -- maximum line length (for uglified code) - `preamble` (default `null`) -- when passed it must be a string and it will be prepended to the output literally. The source map will adjust for this text. Can be used to insert a comment containing licensing information, for example. +- `preserve_line` (default `false`) -- pass `true` to preserve lines, but it + only works if `beautify` is set to `false`. +- `quote_keys` (default `false`) -- pass `true` to quote all keys in literal + objects - `quote_style` (default `0`) -- preferred quote style for strings (affects quoted property names and directives as well): - `0` -- prefers double quotes, switches to single quotes when there are @@ -643,9 +640,19 @@ can pass additional arguments that control the code output: - `1` -- always use single quotes - `2` -- always use double quotes - `3` -- always use the original quotes -- `keep_quoted_props` (default `false`) -- when turned on, prevents stripping - quotes from property names in object literals. - +- `semicolons` (default `true`) -- separate statements with semicolons. If + you pass `false` then whenever possible we will use a newline instead of a + semicolon, leading to more readable output of uglified code (size before + gzip could be smaller; size after gzip insignificantly larger). +- `shebang` (default `true`) -- preserve shebang `#!` in preamble (bash scripts) +- `width` (default 80) -- only takes effect when beautification is on, this + specifies an (orientative) line width that the beautifier will try to + obey. It refers to the width of the line text (excluding indentation). + It doesn't work very well currently, but it does make the code generated + by UglifyJS more readable. +- `wrap_iife` (default `false`) -- pass `true` to wrap immediately invoked + function expressions. See + [#640](https://github.com/mishoo/UglifyJS2/issues/640) for more details. # Miscellaneous |