From a436b8a7ecf4112ce0602b0dab5599a3a17c6078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Santos?= Date: Fri, 16 Mar 2018 15:37:17 +0000 Subject: [PATCH] add `module` option documentation --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 11f09b7f..9e00a27d 100644 --- a/README.md +++ b/README.md @@ -497,6 +497,9 @@ if (result.error) throw result.error; - `mangle.properties` (default `false`) — a subcategory of the mangle option. Pass an object to specify custom [mangle property options](#mangle-properties-options). +- `module` (default `false`) — Use when minifying an ES6 module. "use strict" + is implied and names can be mangled on the top scope. + - `output` (default `null`) — pass an object if you wish to specify additional [output options](#output-options). The defaults are optimized for best compression. @@ -555,6 +558,7 @@ if (result.error) throw result.error; keep_classnames: false, keep_fnames: false, ie8: false, + module: false, nameCache: null, // or specify a name cache object safari10: false, toplevel: false, @@ -703,6 +707,9 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u - `loops` (default: `true`) -- optimizations for `do`, `while` and `for` loops when we can statically determine the condition. +- `module` (default `false`) -- Pass `true` when compressing an ES6 module. Strict + mode is implied and the `toplevel` option as well. + - `negate_iife` (default: `true`) -- negate "Immediately-Called Function Expressions" where the return value is discarded, to avoid the parens that the code generator would insert. @@ -824,6 +831,9 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u Useful for code relying on `Function.prototype.name`. See also: the `keep_fnames` [compress option](#compress-options). +- `module` (default `false`) -- Pass `true` an ES6 modules, where the toplevel + scope is not the global scope. Implies `toplevel`. + - `reserved` (default `[]`) -- Pass an array of identifiers that should be excluded from mangling. Example: `["foo", "bar"]`.