terser 4.6.6 → 4.6.10
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.
Potentially problematic release.
This version of terser might be problematic. Click here for more details.
- package/CHANGELOG.md +20 -0
- package/README.md +7 -4
- package/bin/terser +1 -1
- package/dist/bundle.min.js +1 -1
- package/dist/bundle.min.js.map +1 -1
- package/package.json +12 -6
- package/tools/terser.d.ts +3 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v4.6.10
|
4
|
+
|
5
|
+
- Do not use reduce_vars when classes are present
|
6
|
+
|
7
|
+
## v4.6.9
|
8
|
+
|
9
|
+
- Check if block scopes actually exist in blocks
|
10
|
+
|
11
|
+
## v4.6.8
|
12
|
+
|
13
|
+
- Take into account "executed bits" of classes like static properties or computed keys, when checking if a class evaluation might throw or have side effects.
|
14
|
+
|
15
|
+
## v4.6.7
|
16
|
+
|
17
|
+
- Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first.
|
18
|
+
- An issue with setting `--comments` to `false` in the CLI has been fixed.
|
19
|
+
- Fixed some issues with inlining
|
20
|
+
- `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()`
|
21
|
+
- Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6).
|
22
|
+
|
3
23
|
## v4.6.6
|
4
24
|
|
5
25
|
(hotfix release)
|
package/README.md
CHANGED
@@ -686,6 +686,10 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
686
686
|
|
687
687
|
## Compress options
|
688
688
|
|
689
|
+
- `defaults` (default: `true`) -- Pass `false` to disable most default
|
690
|
+
enabled `compress` transforms. Useful when you only want to enable a few
|
691
|
+
`compress` options while disabling the rest.
|
692
|
+
|
689
693
|
- `arrows` (default: `true`) -- Class and object literal methods are converted
|
690
694
|
will also be converted to arrow expressions if the resultant code is shorter:
|
691
695
|
`m(){return x}` becomes `m:()=>x`. To do this to regular ES5 functions which
|
@@ -715,10 +719,6 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
715
719
|
|
716
720
|
- `dead_code` (default: `true`) -- remove unreachable code
|
717
721
|
|
718
|
-
- `defaults` (default: `true`) -- Pass `false` to disable most default
|
719
|
-
enabled `compress` transforms. Useful when you only want to enable a few
|
720
|
-
`compress` options while disabling the rest.
|
721
|
-
|
722
722
|
- `directives` (default: `true`) -- remove redundant or non-standard directives
|
723
723
|
|
724
724
|
- `drop_console` (default: `false`) -- Pass `true` to discard calls to
|
@@ -865,6 +865,9 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
865
865
|
- `unsafe_math` (default: `false`) -- optimize numerical expressions like
|
866
866
|
`2 * x * 3` into `6 * x`, which may give imprecise floating point results.
|
867
867
|
|
868
|
+
- `unsafe_symbols` (default: `false`) -- removes keys from native Symbol
|
869
|
+
declarations, e.g `Symbol("kDog")` becomes `Symbol()`.
|
870
|
+
|
868
871
|
- `unsafe_methods` (default: false) -- Converts `{ m: function(){} }` to
|
869
872
|
`{ m(){} }`. `ecma` must be set to `6` or greater to enable this transform.
|
870
873
|
If `unsafe_methods` is a RegExp then key/value pairs with keys matching the
|
package/bin/terser
CHANGED
@@ -99,7 +99,7 @@ if (program.beautify) {
|
|
99
99
|
}
|
100
100
|
if (program.comments) {
|
101
101
|
if (typeof options.output != "object") options.output = {};
|
102
|
-
options.output.comments = typeof program.comments == "string" ? program.comments : "some";
|
102
|
+
options.output.comments = typeof program.comments == "string" ? (program.comments == "false" ? false : program.comments) : "some";
|
103
103
|
}
|
104
104
|
if (program.define) {
|
105
105
|
if (typeof options.compress != "object") options.compress = {};
|