mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-02 20:00:05 +02:00
update modules
This commit is contained in:
32
node_modules/terser/README.md
generated
vendored
32
node_modules/terser/README.md
generated
vendored
@@ -90,10 +90,9 @@ a double dash to prevent input files being used as option arguments:
|
||||
`reserved` List of names that should not be mangled.
|
||||
--mangle-props [options] Mangle properties/specify mangler options:
|
||||
`builtins` Mangle property names that overlaps
|
||||
with standard JavaScript globals.
|
||||
with standard JavaScript globals and DOM
|
||||
API props.
|
||||
`debug` Add debug prefix and suffix.
|
||||
`domprops` Mangle property names that overlaps
|
||||
with DOM properties.
|
||||
`keep_quoted` Only mangle unquoted properties, quoted
|
||||
properties are automatically reserved.
|
||||
`strict` disables quoted properties
|
||||
@@ -133,7 +132,7 @@ a double dash to prevent input files being used as option arguments:
|
||||
sequences.
|
||||
--config-file <file> Read `minify()` options from JSON file.
|
||||
-d, --define <expr>[=value] Global definitions.
|
||||
--ecma <version> Specify ECMAScript release: 5, 6, 7 or 8.
|
||||
--ecma <version> Specify ECMAScript release: 5, 2015, 2016, etc.
|
||||
-e, --enclose [arg[:value]] Embed output in a big function with configurable
|
||||
arguments and values.
|
||||
--ie8 Support non-standard Internet Explorer 8.
|
||||
@@ -321,12 +320,8 @@ $ terser example.js -c passes=2 -m --mangle-props regex=/_$/,reserved=[bar_]
|
||||
var x={o:3,t:1,calc:function(){return this.t+this.o},bar_:2};console.log(x.calc());
|
||||
```
|
||||
|
||||
In order for this to be of any use, we avoid mangling standard JS names by
|
||||
default (`--mangle-props builtins` to override).
|
||||
|
||||
A default exclusion file is provided in `tools/domprops.js` which should
|
||||
cover most standard JS and DOM properties defined in various browsers. Pass
|
||||
`--mangle-props domprops` to disable this feature.
|
||||
In order for this to be of any use, we avoid mangling standard JS names and DOM
|
||||
API properties by default (`--mangle-props builtins` to override).
|
||||
|
||||
A regular expression can be used to define which property names should be
|
||||
mangled. For example, `--mangle-props regex=/^_/` will only mangle property
|
||||
@@ -534,7 +529,7 @@ if (result.error) throw result.error;
|
||||
|
||||
## Minify options
|
||||
|
||||
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016` or `2017` to override `parse`,
|
||||
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override `parse`,
|
||||
`compress` and `output`'s `ecma` options.
|
||||
|
||||
- `warnings` (default `false`) — pass `true` to return compressor warnings
|
||||
@@ -611,7 +606,7 @@ if (result.error) throw result.error;
|
||||
sourceMap: {
|
||||
// source map options
|
||||
},
|
||||
ecma: 5, // specify one of: 5, 2015, 2016, 2017 or 2018
|
||||
ecma: 5, // specify one of: 5, 2015, 2016, etc.
|
||||
keep_classnames: false,
|
||||
keep_fnames: false,
|
||||
ie8: false,
|
||||
@@ -686,6 +681,10 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
||||
|
||||
## Compress options
|
||||
|
||||
- `defaults` (default: `true`) -- Pass `false` to disable most default
|
||||
enabled `compress` transforms. Useful when you only want to enable a few
|
||||
`compress` options while disabling the rest.
|
||||
|
||||
- `arrows` (default: `true`) -- Class and object literal methods are converted
|
||||
will also be converted to arrow expressions if the resultant code is shorter:
|
||||
`m(){return x}` becomes `m:()=>x`. To do this to regular ES5 functions which
|
||||
@@ -715,10 +714,6 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
||||
|
||||
- `dead_code` (default: `true`) -- remove unreachable code
|
||||
|
||||
- `defaults` (default: `true`) -- Pass `false` to disable most default
|
||||
enabled `compress` transforms. Useful when you only want to enable a few
|
||||
`compress` options while disabling the rest.
|
||||
|
||||
- `directives` (default: `true`) -- remove redundant or non-standard directives
|
||||
|
||||
- `drop_console` (default: `false`) -- Pass `true` to discard calls to
|
||||
@@ -865,6 +860,9 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
||||
- `unsafe_math` (default: `false`) -- optimize numerical expressions like
|
||||
`2 * x * 3` into `6 * x`, which may give imprecise floating point results.
|
||||
|
||||
- `unsafe_symbols` (default: `false`) -- removes keys from native Symbol
|
||||
declarations, e.g `Symbol("kDog")` becomes `Symbol()`.
|
||||
|
||||
- `unsafe_methods` (default: false) -- Converts `{ m: function(){} }` to
|
||||
`{ m(){} }`. `ecma` must be set to `6` or greater to enable this transform.
|
||||
If `unsafe_methods` is a RegExp then key/value pairs with keys matching the
|
||||
@@ -1318,6 +1316,8 @@ To allow for better optimizations, the compiler makes various assumptions:
|
||||
- Object properties can be added, removed and modified (not prevented with
|
||||
`Object.defineProperty()`, `Object.defineProperties()`, `Object.freeze()`,
|
||||
`Object.preventExtensions()` or `Object.seal()`).
|
||||
- `document.all` is not `== null`
|
||||
- Assigning properties to a class doesn't have side effects and does not throw.
|
||||
|
||||
### Build Tools and Adaptors using Terser
|
||||
|
||||
|
Reference in New Issue
Block a user