From 1c1b53146e5b9bff8c4ffead6407123fb09a5861 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Thu, 3 Mar 2016 11:37:23 -0800 Subject: [PATCH] Update README with mangle except option --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 92559019..2bed9247 100644 --- a/README.md +++ b/README.md @@ -617,6 +617,19 @@ var result = UglifyJS.minify("compiled.js", { The `inSourceMap` is only used if you also request `outSourceMap` (it makes no sense otherwise). +Beside of passing `true` or `false` to `mangle` option, in order to enable or +disable mangling process. The `mangle` option can take an object that allows you to exclude the list of +reserved name by using `except`, which is similar to the `--reserved` option in commandline. + +```javascript +var result = UglifyJS.minify("compiled.js", { + mangle: { + except: ['require', '$super'] // ignore the require, and $super keywords + } +}); +``` + + Other options: - `warnings` (default `false`) — pass `true` to display compressor warnings.