diff options
author | kzc <kzc@users.noreply.github.com> | 2017-05-20 16:55:03 -0400 |
---|---|---|
committer | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-21 04:55:03 +0800 |
commit | a1dedeb3ceb41b6419f877d34228cf0ba4b040a2 (patch) | |
tree | 7cf726cea04891e00cc86e2dc00f0e31c3374fe2 | |
parent | d3c4a8e9e705af2c90b940b0053dad222a45ed34 (diff) | |
download | tracifyjs-a1dedeb3ceb41b6419f877d34228cf0ba4b040a2.tar.gz tracifyjs-a1dedeb3ceb41b6419f877d34228cf0ba4b040a2.zip |
more refinement of minify() documentation (#1983)
-rw-r--r-- | README.md | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -301,9 +301,10 @@ like this: var UglifyJS = require("uglify-js"); ``` -There is a single high level minification function, `minify(code, options)`, which will -performs all the steps in a configurable manner. -Example: +There is a single high level function, **`minify(code, options)`**, +which will perform all minification [phases](#minify-options) in a configurable +manner. By default `minify()` will enable the options [`compress`](#compress-options) +and [`mangle`](#mangle-options). Example: ```javascript var code = "function add(first, second) { return first + second; }"; var result = UglifyJS.minify(code); @@ -311,7 +312,9 @@ console.log(result.error); // runtime error, or `undefined` if no error console.log(result.code); // minified output: function add(n,d){return n+d} ``` -You can also compress multiple files: +You can `minify` more than one JavaScript file at a time by using an object +for the first argument where the keys are file names and the values are source +code: ```javascript var code = { "file1.js": "function add(first, second) { return first + second; }", |