terser 5.0.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/LICENSE +1 -1
- package/README.md +2 -6
- package/dist/bundle.min.js +2538 -97
- package/dist/bundle.min.js.map +1 -1
- package/lib/ast.js +28 -4
- package/lib/compress/index.js +179 -66
- package/lib/equivalent-to.js +3 -0
- package/lib/minify.js +5 -1
- package/lib/mozilla-ast.js +40 -3
- package/lib/output.js +18 -3
- package/lib/parse.js +107 -15
- package/lib/size.js +15 -4
- package/package.json +3 -2
- package/tools/domprops.js +2152 -1
- package/tools/terser.d.ts +2 -3
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.3.0
|
4
|
+
|
5
|
+
- Fixed a crash when compressing object spreads in some cases
|
6
|
+
- Fixed compiletime evaluation of optional chains (caused typeof a?.b to always return "object")
|
7
|
+
- domprops has been updated to contain every single possible prop
|
8
|
+
|
9
|
+
## v5.2.1
|
10
|
+
|
11
|
+
- The parse step now doesn't accept an `ecma` option, so that all ES code is accepted.
|
12
|
+
- Optional dotted chains now accept keywords, just like dotted expressions (`foo?.default`)
|
13
|
+
|
14
|
+
## v5.2.0
|
15
|
+
|
16
|
+
- Optional chaining syntax is now supported.
|
17
|
+
- Consecutive await expressions don't have unnecessary parens
|
18
|
+
- Taking the variable name's length (after mangling) into consideration when deciding to inline
|
19
|
+
|
20
|
+
## v5.1.0
|
21
|
+
|
22
|
+
- `import.meta` is now supported
|
23
|
+
- Typescript typings have been improved
|
24
|
+
|
3
25
|
## v5.0.0
|
4
26
|
|
5
27
|
- `in` operator now taken into account during property mangle.
|
@@ -12,6 +34,7 @@
|
|
12
34
|
- BREAKING: `minify()` is now async and rejects a promise instead of returning an error.
|
13
35
|
- BREAKING: Internal AST is no longer exposed, so that it can be improved without releasing breaking changes.
|
14
36
|
- BREAKING: Lowest supported node version is 10
|
37
|
+
- BREAKING: There are no more warnings being emitted
|
15
38
|
- Module is now distributed as a dual package - You can `import` and `require()` too.
|
16
39
|
- Inline improvements were made
|
17
40
|
|
package/LICENSE
CHANGED
package/README.md
CHANGED
@@ -411,7 +411,7 @@ Browser loading is also supported:
|
|
411
411
|
|
412
412
|
There is a single async high level function, **`async minify(code, options)`**,
|
413
413
|
which will perform all minification [phases](#minify-options) in a configurable
|
414
|
-
manner. By default `minify()` will enable the options [`compress`](#compress-options)
|
414
|
+
manner. There is no synchronous function, but this functionality can be achieved with a package like [deasync](https://github.com/abbr/deasync). By default `minify()` will enable the options [`compress`](#compress-options)
|
415
415
|
and [`mangle`](#mangle-options). Example:
|
416
416
|
```javascript
|
417
417
|
var code = "function add(first, second) { return first + second; }";
|
@@ -522,7 +522,7 @@ try {
|
|
522
522
|
|
523
523
|
## Minify options
|
524
524
|
|
525
|
-
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override
|
525
|
+
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override
|
526
526
|
`compress` and `format`'s `ecma` options.
|
527
527
|
|
528
528
|
- `parse` (default `{}`) — pass an object if you wish to specify some
|
@@ -660,10 +660,6 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
660
660
|
|
661
661
|
- `bare_returns` (default `false`) -- support top level `return` statements
|
662
662
|
|
663
|
-
- `ecma` (default: `2017`) -- specify one of `5`, `2015`, `2016` or `2017`. Note: this setting
|
664
|
-
is not presently enforced except for ES8 optional trailing commas in function
|
665
|
-
parameter lists and calls with `ecma` `2017`.
|
666
|
-
|
667
663
|
- `html5_comments` (default `true`)
|
668
664
|
|
669
665
|
- `shebang` (default `true`) -- support `#!command` as the first line
|