update deps

This commit is contained in:
s2
2019-12-20 20:02:44 +01:00
parent 14c1b72301
commit b7fa481dcb
833 changed files with 68364 additions and 18390 deletions

150
node_modules/terser/README.md generated vendored
View File

@@ -1,29 +1,34 @@
terser
======
<h1><img src="https://terser.org/img/terser-banner-logo.png" alt="Terser" width="400"></h1>
![Terser](https://raw.githubusercontent.com/terser-js/terser/master/logo.png)
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Linux Build][travis-image]][travis-url]
A JavaScript parser and mangler/compressor toolkit for ES6+.
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/fabiosantoscode"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out PATRONS.md for our first-tier patrons.
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/fabiosantoscode"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons.
Terser recommends you use RollupJS to bundle your modules, as that produces smaller code overall.
*Beautification* has been undocumented and is *being removed* from terser, we recommend you use [prettier](https://npmjs.com/package/prettier).
[![Build Status](https://travis-ci.org/terser-js/terser.svg?branch=master)](https://travis-ci.org/terser-js/terser)
Find the changelog in [CHANGELOG.md](https://github.com/terser/terser/blob/master/CHANGELOG.md)
Find the changelog in [CHANGELOG.md](https://github.com/terser-js/terser/blob/master/CHANGELOG.md)
A JavaScript parser, mangler/compressor and beautifier toolkit for ES6+.
[npm-image]: https://img.shields.io/npm/v/terser.svg
[npm-url]: https://npmjs.org/package/terser
[downloads-image]: https://img.shields.io/npm/dm/terser.svg
[downloads-url]: https://npmjs.org/package/terser
[travis-image]: https://img.shields.io/travis/terser/terser/master.svg
[travis-url]: https://travis-ci.org/terser/terser
Why choose terser?
------------------
`uglify-es` is [no longer maintained](https://github.com/mishoo/UglifyJS2/issues/3156#issuecomment-392943058) and `uglify-js` does not support ES6+.
**`terser`** is a fork of `uglify-es` that retains API and CLI compatibility
**`terser`** is a fork of `uglify-es` that mostly retains API and CLI compatibility
with `uglify-es` and `uglify-js@3`.
Install
@@ -39,7 +44,7 @@ From NPM for use as a command line app:
From NPM for programmatic use:
npm install terser
# Command line usage
terser [input files] [options]
@@ -86,7 +91,10 @@ a double dash to prevent input files being used as option arguments:
`debug` Add debug prefix and suffix.
`domprops` Mangle property names that overlaps
with DOM properties.
`keep_quoted` Only mangle unquoted properties.
`keep_quoted` Only mangle unquoted properties, quoted
properties are automatically reserved.
`strict` disables quoted properties
being automatically reserved.
`regex` Only mangle matched property names.
`reserved` List of names that should not be mangled.
-b, --beautify [options] Specify output options:
@@ -103,6 +111,7 @@ a double dash to prevent input files being used as option arguments:
`wrap_iife` Wrap IIFEs in parenthesis. Note: you may
want to disable `negate_iife` under
compressor options.
`wrap_func_args` Wrap function arguments in parenthesis.
-o, --output <file> Output file path (default STDOUT). Specify `ast` or
`spidermonkey` to write Terser or SpiderMonkey AST
as JSON to STDOUT respectively.
@@ -112,6 +121,7 @@ a double dash to prevent input files being used as option arguments:
"@preserve". You can optionally pass one of the
following arguments to this flag:
- "all" to keep all comments
- `false` to omit comments in the output
- a valid JS RegExp like `/foo/` or `/^!/` to
keep only matching comments.
Note that currently not *all* comments can be
@@ -252,7 +262,7 @@ way to use this is to use the `regex` option like so:
terser example.js -c -m --mangle-props regex=/_$/
```
This will mangle all properties that start with an
This will mangle all properties that end with an
underscore. So you can use it to mangle internal methods.
By default, it will mangle all properties in the
@@ -280,38 +290,38 @@ console.log(x.calc());
```
Mangle all properties (except for JavaScript `builtins`) (**very** unsafe):
```bash
$ terser example.js -c -m --mangle-props
$ terser example.js -c passes=2 -m --mangle-props
```
```javascript
var x={o:0,_:1,l:function(){return this._+this.o}};x.t=2,x.o=3,console.log(x.l());
var x={o:3,t:1,i:function(){return this.t+this.o},s:2};console.log(x.i());
```
Mangle all properties except for `reserved` properties (still very unsafe):
```bash
$ terser example.js -c -m --mangle-props reserved=[foo_,bar_]
$ terser example.js -c passes=2 -m --mangle-props reserved=[foo_,bar_]
```
```javascript
var x={o:0,foo_:1,_:function(){return this.foo_+this.o}};x.bar_=2,x.o=3,console.log(x._());
var x={o:3,foo_:1,t:function(){return this.foo_+this.o},bar_:2};console.log(x.t());
```
Mangle all properties matching a `regex` (not as unsafe but still unsafe):
```bash
$ terser example.js -c -m --mangle-props regex=/_$/
$ terser example.js -c passes=2 -m --mangle-props regex=/_$/
```
```javascript
var x={o:0,_:1,calc:function(){return this._+this.o}};x.l=2,x.o=3,console.log(x.calc());
var x={o:3,t:1,calc:function(){return this.t+this.o},i:2};console.log(x.calc());
```
Combining mangle properties options:
```bash
$ terser example.js -c -m --mangle-props regex=/_$/,reserved=[bar_]
$ terser example.js -c passes=2 -m --mangle-props regex=/_$/,reserved=[bar_]
```
```javascript
var x={o:0,_:1,calc:function(){return this._+this.o}};x.bar_=2,x.o=3,console.log(x.calc());
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.json` which should
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.
@@ -522,7 +532,7 @@ if (result.error) throw result.error;
## Minify options
- `ecma` (default `undefined`) - pass `5`, `6`, `7` or `8` to override `parse`,
`compress` and `output` options.
`compress` and `output`'s `ecma` options.
- `warnings` (default `false`) — pass `true` to return compressor warnings
in `result.warnings`. Use the value `"verbose"` for more detailed warnings.
@@ -657,6 +667,8 @@ var result = Terser.minify({"compiled.js": "compiled code"}, {
If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.url`.
If you happen to need the source map as a raw object, set `sourceMap.asObject` to `true`.
## Parse options
- `bare_returns` (default `false`) -- support top level `return` statements
@@ -754,7 +766,7 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
- `keep_fnames` (default: `false`) -- Pass `true` to prevent the
compressor from discarding function names. Pass a regular expression to only keep
class names matching that regex. Useful for code relying on `Function.prototype.name`.
function names matching that regex. Useful for code relying on `Function.prototype.name`.
See also: the `keep_fnames` [mangle option](#mangle).
- `keep_infinity` (default: `false`) -- Pass `true` to prevent `Infinity` from
@@ -794,11 +806,7 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
Specify `"strict"` to treat `foo.bar` as side-effect-free only when
`foo` is certain to not throw, i.e. not `null` or `undefined`.
- `reduce_funcs` (default: `true`) -- Allows single-use functions to be
inlined as function expressions when permissible allowing further
optimization. Enabled by default. Option depends on `reduce_vars`
being enabled. Some code runs faster in the Chrome V8 engine if this
option is disabled. Does not negatively impact other major browsers.
- `reduce_funcs` (legacy option, safely ignored for backwards compatibility).
- `reduce_vars` (default: `true`) -- Improve optimization on variables assigned with and
used as constant values.
@@ -813,7 +821,7 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
case a value of `20` or less is recommended.
- `side_effects` (default: `true`) -- Pass `false` to disable potentially dropping
functions marked as "pure". A function call is marked as "pure" if a comment
function calls marked as "pure". A function call is marked as "pure" if a comment
annotation `/*@__PURE__*/` or `/*#__PURE__*/` immediately precedes the call. For
example: `/*@__PURE__*/foo();`
@@ -928,20 +936,28 @@ Terser.minify(code, { mangle: { toplevel: true } }).code;
### Mangle properties options
- `builtins` (default: `false`) -- Use `true` to allow the mangling of builtin
- `builtins` (default: `false`) Use `true` to allow the mangling of builtin
DOM properties. Not recommended to override this setting.
- `debug` (default: `false`) -— Mangle names with the original name still present.
- `debug` (default: `false`) — Mangle names with the original name still present.
Pass an empty string `""` to enable, or a non-empty string to set the debug suffix.
- `keep_quoted` (default: `false`) -— Only mangle unquoted property names.
- `keep_quoted` (default: `false`) — Only mangle unquoted property names.
- `true` -- Quoted property names are automatically reserved and any unquoted
property names will not be mangled.
- `"strict"` -- Advanced, all unquoted property names are mangled unless
explicitly reserved.
- `regex` (default: `null`) -— Pass a RegExp literal to only mangle property
names matching the regular expression.
- `regex` (default: `null`) — Pass a [RegExp literal or pattern string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) to only mangle property matching the regular expression.
- `reserved` (default: `[]`) -- Do not mangle property names listed in the
- `reserved` (default: `[]`) Do not mangle property names listed in the
`reserved` array.
- `undeclared` (default: `false`) - Mangle those names when they are accessed
as properties of known top level variables but their declarations are never
found in input code. May be useful when only minifying parts of a project.
See [#397](https://github.com/terser/terser/issues/397) for more details.
## Output options
The code generator tries to output shortest code possible by default. In
@@ -960,8 +976,9 @@ can pass additional arguments that control the code output:
`do`, `while` or `with` statements, even if their body is a single
statement.
- `comments` (default `false`) -- pass `true` or `"all"` to preserve all
comments, `"some"` to preserve some comments, a regular expression string
- `comments` (default `"some"`) -- by default it keeps JSDoc-style comments
that contain "@license" or "@preserve", pass `true` or `"all"` to preserve all
comments, `false` to omit comments in the output, a regular expression string
(e.g. `/^!/`) or a function.
- `ecma` (default `5`) -- set output printing mode. Set `ecma` to `6` or
@@ -1017,6 +1034,10 @@ can pass additional arguments that control the code output:
function expressions. See
[#640](https://github.com/mishoo/UglifyJS2/issues/640) for more details.
- `wrap_func_args` (default `true`) -- pass `false` if you do not want to wrap
function expressions that are passed as arguments, in parenthesis. See
[OptimizeJS](https://github.com/nolanlawson/optimize-js) for more details.
# Miscellaneous
### Keeping copyright notices or other comments
@@ -1173,6 +1194,30 @@ var result = Terser.minify(ast, {
// result.code contains the minified code in string form.
```
### Annotations
Annotations in Terser are a way to tell it to treat a certain function call differently. The following annotations are available:
* `/*@__INLINE__*/` - forces a function to be inlined somewhere.
* `/*@__NOINLINE__*/` - Makes sure the called function is not inlined into the call site.
* `/*@__PURE__*/` - Marks a function call as pure. That means, it can safely be dropped.
You can use either a `@` sign at the start, or a `#`.
Here are some examples on how to use them:
```javascript
/*@__INLINE__*/
function_always_inlined_here()
/*#__NOINLINE__*/
function_cant_be_inlined_into_here()
const x = /*#__PURE__*/i_am_dropped_if_x_is_not_used()
```
### Working with Terser AST
Traversal and transformation of the native AST can be performed through
@@ -1298,8 +1343,39 @@ In the terser CLI we use [source-map-support](https://npmjs.com/source-map-suppo
# README.md Patrons:
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/terser_ecmacomp_maintainer"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out PATRONS.md for our first-tier patrons.
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/fabiosantoscode"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons.
These are the second-tier patrons. Great thanks for your support!
* CKEditor ![](https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/15452278/f8548dcf48d740619071e8d614459280/1?token-time=2145916800&token-hash=SIQ54PhIPHv3M7CVz9LxS8_8v4sOw4H304HaXsXj8MM%3D)
* 38elements ![](https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12501844/88e7fc5dd62d45c6a5626533bbd48cfb/1?token-time=2145916800&token-hash=c3AsQ5T0IQWic0zKxFHu-bGGQJkXQFvafvJ4bPerFR4%3D)
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/terser/terser/graphs/contributors"><img src="https://opencollective.com/terser/contributors.svg?width=890&button=false" /></a>
### Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/terser/contribute)]
#### Individuals
<a href="https://opencollective.com/terser"><img src="https://opencollective.com/terser/individuals.svg?width=890"></a>
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/terser/contribute)]
<a href="https://opencollective.com/terser/organization/0/website"><img src="https://opencollective.com/terser/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/1/website"><img src="https://opencollective.com/terser/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/2/website"><img src="https://opencollective.com/terser/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/3/website"><img src="https://opencollective.com/terser/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/4/website"><img src="https://opencollective.com/terser/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/5/website"><img src="https://opencollective.com/terser/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/6/website"><img src="https://opencollective.com/terser/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/7/website"><img src="https://opencollective.com/terser/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/8/website"><img src="https://opencollective.com/terser/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/terser/organization/9/website"><img src="https://opencollective.com/terser/organization/9/avatar.svg"></a>