terser 5.7.1 → 5.7.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 +11 -0
- package/README.md +8 -2
- package/dist/bundle.min.js +4166 -3556
- package/lib/ast.js +0 -2
- package/lib/compress/common.js +296 -0
- package/lib/compress/compressor-flags.js +63 -0
- package/lib/compress/drop-side-effect-free.js +353 -0
- package/lib/compress/evaluate.js +458 -0
- package/lib/compress/index.js +206 -3609
- package/lib/compress/inference.js +934 -0
- package/lib/compress/native-objects.js +183 -0
- package/lib/compress/reduce-vars.js +675 -0
- package/lib/compress/tighten-body.js +1439 -0
- package/lib/output.js +9 -5
- package/lib/parse.js +4 -2
- package/lib/scope.js +4 -4
- package/package.json +2 -2
- package/tools/terser.d.ts +1 -0
- package/bin/terser.mjs +0 -21
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.7.2
|
4
|
+
|
5
|
+
- Fixed issues with compressing functions defined in `global_defs` option (#1036)
|
6
|
+
- New recipe for using Terser in gulp was added to RECIPES.md (#1035)
|
7
|
+
- Fixed issues with `??` and `?.` (#1045)
|
8
|
+
- Future reserved words such as `package` no longer require you to disable strict mode to be used as names.
|
9
|
+
- Refactored huge compressor file into multiple more focused files.
|
10
|
+
- Avoided unparenthesized `in` operator in some for loops (it breaks parsing because of for..in loops)
|
11
|
+
- Improved documentation (#1021, #1025)
|
12
|
+
- More type definitions (#1021)
|
13
|
+
|
3
14
|
## v5.7.1
|
4
15
|
|
5
16
|
- Avoided collapsing assignments together if it would place a chain assignment on the left hand side, which is invalid syntax (`a?.b = c`)
|
package/README.md
CHANGED
@@ -530,6 +530,11 @@ try {
|
|
530
530
|
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override
|
531
531
|
`compress` and `format`'s `ecma` options.
|
532
532
|
|
533
|
+
- `enclose` (default `false`) - pass `true`, or a string in the format
|
534
|
+
of `"args[:values]"`, where `args` and `values` are comma-separated
|
535
|
+
argument names and values, respectively, to embed the output in a big
|
536
|
+
function with the configurable arguments and values.
|
537
|
+
|
533
538
|
- `parse` (default `{}`) — pass an object if you wish to specify some
|
534
539
|
additional [parse options](#parse-options).
|
535
540
|
|
@@ -569,7 +574,7 @@ try {
|
|
569
574
|
of class names. Pass a regular expression to only keep class names matching that regex.
|
570
575
|
|
571
576
|
- `keep_fnames` (default: `false`) - pass `true` to prevent discarding or mangling
|
572
|
-
of function names. Pass a regular expression to only keep
|
577
|
+
of function names. Pass a regular expression to only keep function names matching that regex.
|
573
578
|
Useful for code relying on `Function.prototype.name`. If the top level minify option
|
574
579
|
`keep_classnames` is `undefined` it will be overridden with the value of the top level
|
575
580
|
minify option `keep_fnames`.
|
@@ -602,6 +607,7 @@ try {
|
|
602
607
|
// source map options
|
603
608
|
},
|
604
609
|
ecma: 5, // specify one of: 5, 2015, 2016, etc.
|
610
|
+
enclose: false, // or specify true, or "args:values"
|
605
611
|
keep_classnames: false,
|
606
612
|
keep_fnames: false,
|
607
613
|
ie8: false,
|
@@ -885,7 +891,7 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
885
891
|
See also: the `keep_classnames` [compress option](#compress-options).
|
886
892
|
|
887
893
|
- `keep_fnames` (default `false`) -- Pass `true` to not mangle function names.
|
888
|
-
Pass a regular expression to only keep
|
894
|
+
Pass a regular expression to only keep function names matching that regex.
|
889
895
|
Useful for code relying on `Function.prototype.name`. See also: the `keep_fnames`
|
890
896
|
[compress option](#compress-options).
|
891
897
|
|