terser 4.6.8 → 4.6.12
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 +22 -0
- package/README.md +8 -12
- package/dist/bundle.min.js +1 -1
- package/dist/bundle.min.js.map +1 -1
- package/package.json +3 -3
- package/tools/terser.d.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v4.6.12
|
4
|
+
|
5
|
+
- Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]`
|
6
|
+
- Printing of unicode identifiers has been improved
|
7
|
+
|
8
|
+
## v4.6.11
|
9
|
+
|
10
|
+
- Read unused classes' properties and method keys, to figure out if they use other variables.
|
11
|
+
- Prevent inlining into block scopes when there are name collisions
|
12
|
+
- Functions are no longer inlined into parameter defaults, because they live in their own special scope.
|
13
|
+
- When inlining identity functions, take into account the fact they may be used to drop `this` in function calls.
|
14
|
+
- Nullish coalescing operator (`x ?? y`), plus basic optimization for it.
|
15
|
+
- Template literals in binary expressions such as `+` have been further optimized
|
16
|
+
|
17
|
+
## v4.6.10
|
18
|
+
|
19
|
+
- Do not use reduce_vars when classes are present
|
20
|
+
|
21
|
+
## v4.6.9
|
22
|
+
|
23
|
+
- Check if block scopes actually exist in blocks
|
24
|
+
|
3
25
|
## v4.6.8
|
4
26
|
|
5
27
|
- 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.
|
package/README.md
CHANGED
@@ -90,10 +90,9 @@ a double dash to prevent input files being used as option arguments:
|
|
90
90
|
`reserved` List of names that should not be mangled.
|
91
91
|
--mangle-props [options] Mangle properties/specify mangler options:
|
92
92
|
`builtins` Mangle property names that overlaps
|
93
|
-
with standard JavaScript globals
|
93
|
+
with standard JavaScript globals and DOM
|
94
|
+
API props.
|
94
95
|
`debug` Add debug prefix and suffix.
|
95
|
-
`domprops` Mangle property names that overlaps
|
96
|
-
with DOM properties.
|
97
96
|
`keep_quoted` Only mangle unquoted properties, quoted
|
98
97
|
properties are automatically reserved.
|
99
98
|
`strict` disables quoted properties
|
@@ -133,7 +132,7 @@ a double dash to prevent input files being used as option arguments:
|
|
133
132
|
sequences.
|
134
133
|
--config-file <file> Read `minify()` options from JSON file.
|
135
134
|
-d, --define <expr>[=value] Global definitions.
|
136
|
-
--ecma <version> Specify ECMAScript release: 5,
|
135
|
+
--ecma <version> Specify ECMAScript release: 5, 2015, 2016, etc.
|
137
136
|
-e, --enclose [arg[:value]] Embed output in a big function with configurable
|
138
137
|
arguments and values.
|
139
138
|
--ie8 Support non-standard Internet Explorer 8.
|
@@ -321,12 +320,8 @@ $ terser example.js -c passes=2 -m --mangle-props regex=/_$/,reserved=[bar_]
|
|
321
320
|
var x={o:3,t:1,calc:function(){return this.t+this.o},bar_:2};console.log(x.calc());
|
322
321
|
```
|
323
322
|
|
324
|
-
In order for this to be of any use, we avoid mangling standard JS names
|
325
|
-
default (`--mangle-props builtins` to override).
|
326
|
-
|
327
|
-
A default exclusion file is provided in `tools/domprops.js` which should
|
328
|
-
cover most standard JS and DOM properties defined in various browsers. Pass
|
329
|
-
`--mangle-props domprops` to disable this feature.
|
323
|
+
In order for this to be of any use, we avoid mangling standard JS names and DOM
|
324
|
+
API properties by default (`--mangle-props builtins` to override).
|
330
325
|
|
331
326
|
A regular expression can be used to define which property names should be
|
332
327
|
mangled. For example, `--mangle-props regex=/^_/` will only mangle property
|
@@ -534,7 +529,7 @@ if (result.error) throw result.error;
|
|
534
529
|
|
535
530
|
## Minify options
|
536
531
|
|
537
|
-
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016
|
532
|
+
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override `parse`,
|
538
533
|
`compress` and `output`'s `ecma` options.
|
539
534
|
|
540
535
|
- `warnings` (default `false`) — pass `true` to return compressor warnings
|
@@ -611,7 +606,7 @@ if (result.error) throw result.error;
|
|
611
606
|
sourceMap: {
|
612
607
|
// source map options
|
613
608
|
},
|
614
|
-
ecma: 5, // specify one of: 5, 2015, 2016,
|
609
|
+
ecma: 5, // specify one of: 5, 2015, 2016, etc.
|
615
610
|
keep_classnames: false,
|
616
611
|
keep_fnames: false,
|
617
612
|
ie8: false,
|
@@ -1321,6 +1316,7 @@ To allow for better optimizations, the compiler makes various assumptions:
|
|
1321
1316
|
- Object properties can be added, removed and modified (not prevented with
|
1322
1317
|
`Object.defineProperty()`, `Object.defineProperties()`, `Object.freeze()`,
|
1323
1318
|
`Object.preventExtensions()` or `Object.seal()`).
|
1319
|
+
- `document.all` is not `== null`
|
1324
1320
|
|
1325
1321
|
### Build Tools and Adaptors using Terser
|
1326
1322
|
|