terser 5.16.0 → 5.16.2
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 +18 -0
- package/README.md +4 -4
- package/dist/bundle.min.js +3320 -3113
- package/lib/ast.js +7 -2
- package/lib/compress/common.js +3 -2
- package/lib/compress/drop-unused.js +482 -0
- package/lib/compress/evaluate.js +7 -0
- package/lib/compress/index.js +5 -392
- package/lib/compress/inference.js +1 -2
- package/lib/compress/inline.js +1 -19
- package/lib/compress/native-objects.js +22 -0
- package/lib/compress/tighten-body.js +38 -30
- package/lib/minify.js +9 -6
- package/lib/mozilla-ast.js +83 -34
- package/lib/output.js +44 -12
- package/lib/parse.js +48 -13
- package/lib/scope.js +33 -9
- package/lib/size.js +6 -8
- package/package.json +1 -1
- package/tools/terser.d.ts +1 -0
- package/bin/terser.mjs +0 -21
package/CHANGELOG.md
CHANGED
@@ -1,7 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.16.2
|
4
|
+
|
5
|
+
- Fix sourcemaps with non-ascii characters (#1318)
|
6
|
+
- Support string module name and export * as (#1336)
|
7
|
+
- Do not move `let` out of `for` initializers, as it can change scoping
|
8
|
+
- Fix a corner case that would generate the invalid syntax `if (something) let x` ("let" in braceless if body)
|
9
|
+
- Knowledge of more native object properties (#1330)
|
10
|
+
- Got rid of Travis (#1323)
|
11
|
+
- Added semi-secret `asObject` sourcemap option to typescript defs (#1321)
|
12
|
+
|
3
13
|
## v5.16.1
|
4
14
|
|
15
|
+
- Properly handle references in destructurings (`const { [reference]: val } = ...`)
|
16
|
+
- Allow parsing of `.#privatefield` in nested classes
|
17
|
+
- Do not evaluate operations that return large strings if that would make the output code larger
|
18
|
+
- Make `collapse_vars` handle block scope correctly
|
19
|
+
- Internal improvements: Typos (#1311), more tests, small-scale refactoring
|
20
|
+
|
21
|
+
## v5.16.0
|
22
|
+
|
5
23
|
- Disallow private fields in object bodies (#1011)
|
6
24
|
- Parse `#privatefield in object` (#1279)
|
7
25
|
- Compress `#privatefield in object`
|
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
4
4
|
[![NPM Downloads][downloads-image]][downloads-url]
|
5
|
-
[![
|
5
|
+
[![CI pipeline][ci-image]][ci-url]
|
6
6
|
[![Opencollective financial contributors][opencollective-contributors]][opencollective-url]
|
7
7
|
|
8
8
|
A JavaScript mangler/compressor toolkit for ES6+.
|
@@ -21,8 +21,8 @@ Find the changelog in [CHANGELOG.md](https://github.com/terser/terser/blob/maste
|
|
21
21
|
[npm-url]: https://npmjs.org/package/terser
|
22
22
|
[downloads-image]: https://img.shields.io/npm/dm/terser.svg
|
23
23
|
[downloads-url]: https://npmjs.org/package/terser
|
24
|
-
[
|
25
|
-
[
|
24
|
+
[ci-image]: https://github.com/terser/terser/actions/workflows/ci.yml/badge.svg
|
25
|
+
[ci-url]: https://github.com/terser/terser/actions/workflows/ci.yml
|
26
26
|
[opencollective-contributors]: https://opencollective.com/terser/tiers/badge.svg
|
27
27
|
[opencollective-url]: https://opencollective.com/terser
|
28
28
|
|
@@ -758,7 +758,7 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
758
758
|
- `3` -- inline functions with arguments and variables
|
759
759
|
- `true` -- same as `3`
|
760
760
|
|
761
|
-
- `join_vars` (default: `true`) -- join consecutive `var` statements
|
761
|
+
- `join_vars` (default: `true`) -- join consecutive `var`, `let` and `const` statements
|
762
762
|
|
763
763
|
- `keep_classnames` (default: `false`) -- Pass `true` to prevent the compressor from
|
764
764
|
discarding class names. Pass a regular expression to only keep class names matching
|