terser 5.19.3 → 5.20.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 +10 -0
- package/README.md +3 -4
- package/dist/bundle.min.js +270 -20
- package/lib/compress/index.js +24 -13
- package/lib/compress/inline.js +4 -0
- package/lib/compress/tighten-body.js +5 -1
- package/lib/minify.js +3 -0
- package/lib/mozilla-ast.js +3 -5
- package/package.json +1 -1
- package/tools/domprops.js +231 -1
- package/tools/terser.d.ts +4 -1
- package/bin/terser.mjs +0 -18
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.20.0
|
4
|
+
- Passing `minify()` zero files will now throw a clean exception (#1450)
|
5
|
+
- `drop_console` supports passing in an array of `console.*` method names (#1445)
|
6
|
+
- New DOM properties from the WebGPU API have been added for use in the property mangler (#1436)
|
7
|
+
- Internal code simplification (#1437)
|
8
|
+
|
9
|
+
## v5.19.4
|
10
|
+
- Prevent creating very deeply nested ternaries from a long list of `if..return`
|
11
|
+
- Prevent inlining classes into other functions, to avoid constructors being compared.
|
12
|
+
|
3
13
|
## v5.19.3
|
4
14
|
- Fix side effect detection of `optional?.chains`.
|
5
15
|
- Add roundRect to domprops.js (#1426)
|
package/README.md
CHANGED
@@ -417,7 +417,7 @@ Or,
|
|
417
417
|
import { minify } from "terser";
|
418
418
|
```
|
419
419
|
|
420
|
-
Browser loading is also supported:
|
420
|
+
Browser loading is also supported. It exposes a global variable `Terser` containing a `.minify` property:
|
421
421
|
```html
|
422
422
|
<script src="https://cdn.jsdelivr.net/npm/source-map@0.7.3/dist/source-map.js"></script>
|
423
423
|
<script src="https://cdn.jsdelivr.net/npm/terser/dist/bundle.min.js"></script>
|
@@ -729,9 +729,8 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
|
|
729
729
|
- `directives` (default: `true`) -- remove redundant or non-standard directives
|
730
730
|
|
731
731
|
- `drop_console` (default: `false`) -- Pass `true` to discard calls to
|
732
|
-
`console.*` functions. If you
|
733
|
-
|
734
|
-
after dropping the function call then use `pure_funcs` instead.
|
732
|
+
`console.*` functions. If you only want to discard a portion of console,
|
733
|
+
you can pass an array like this `['log', 'info']`, which will only discard `console.log`、 `console.info`.
|
735
734
|
|
736
735
|
- `drop_debugger` (default: `true`) -- remove `debugger;` statements
|
737
736
|
|