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/tools/terser.d.ts
CHANGED
@@ -4,6 +4,9 @@ import { SectionedSourceMapInput, EncodedSourceMap, DecodedSourceMap } from '@jr
|
|
4
4
|
|
5
5
|
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
|
6
6
|
|
7
|
+
export type ConsoleProperty = keyof typeof console;
|
8
|
+
type DropConsoleOption = boolean | ConsoleProperty[];
|
9
|
+
|
7
10
|
export interface ParseOptions {
|
8
11
|
bare_returns?: boolean;
|
9
12
|
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
@@ -24,7 +27,7 @@ export interface CompressOptions {
|
|
24
27
|
dead_code?: boolean;
|
25
28
|
defaults?: boolean;
|
26
29
|
directives?: boolean;
|
27
|
-
drop_console?:
|
30
|
+
drop_console?: DropConsoleOption;
|
28
31
|
drop_debugger?: boolean;
|
29
32
|
ecma?: ECMA;
|
30
33
|
evaluate?: boolean;
|
package/bin/terser.mjs
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
|
3
|
-
"use strict";
|
4
|
-
|
5
|
-
import "../tools/exit.cjs";
|
6
|
-
|
7
|
-
import fs from "fs";
|
8
|
-
import path from "path";
|
9
|
-
import program from "commander";
|
10
|
-
|
11
|
-
import { _run_cli as run_cli } from "../main.js";
|
12
|
-
|
13
|
-
const packageJson= JSON.parse( fs.readFileSync( new URL("./package.json", import.meta.url)));
|
14
|
-
|
15
|
-
run_cli({ program, packageJson, fs, path }).catch((error) => {
|
16
|
-
console.error(error);
|
17
|
-
process.exitCode = 1;
|
18
|
-
});
|