This commit is contained in:
Khoa Pham 2016-03-27 17:45:34 +00:00
commit b869bffab4

View File

@ -633,6 +633,19 @@ var result = UglifyJS.minify("compiled.js", {
The `inSourceMap` is only used if you also request `outSourceMap` (it makes The `inSourceMap` is only used if you also request `outSourceMap` (it makes
no sense otherwise). 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: Other options:
- `warnings` (default `false`) — pass `true` to display compressor warnings. - `warnings` (default `false`) — pass `true` to display compressor warnings.