terser 4.8.0 → 5.0.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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "homepage": "https://terser.org",
5
5
  "author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
6
6
  "license": "BSD-2-Clause",
7
- "version": "4.8.0",
7
+ "version": "5.0.0",
8
8
  "engines": {
9
9
  "node": ">=6.0.0"
10
10
  },
@@ -13,6 +13,19 @@
13
13
  ],
14
14
  "repository": "https://github.com/terser/terser",
15
15
  "main": "dist/bundle.min.js",
16
+ "type": "module",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./main.js",
20
+ "require": "./dist/bundle.min.js"
21
+ },
22
+ "./package": {
23
+ "default": "./package.json"
24
+ },
25
+ "./package.json": {
26
+ "default": "./package.json"
27
+ }
28
+ },
16
29
  "types": "tools/terser.d.ts",
17
30
  "bin": {
18
31
  "terser": "bin/terser"
@@ -20,11 +33,13 @@
20
33
  "files": [
21
34
  "bin",
22
35
  "dist",
36
+ "lib",
23
37
  "tools",
24
38
  "LICENSE",
25
39
  "README.md",
26
40
  "CHANGELOG.md",
27
- "PATRONS.md"
41
+ "PATRONS.md",
42
+ "main.js"
28
43
  ],
29
44
  "dependencies": {
30
45
  "commander": "^2.20.0",
@@ -32,25 +47,26 @@
32
47
  "source-map-support": "~0.5.12"
33
48
  },
34
49
  "devDependencies": {
50
+ "@ls-lint/ls-lint": "^1.9.2",
35
51
  "acorn": "^7.1.1",
36
52
  "astring": "^1.4.1",
37
- "eslint": "^6.3.0",
53
+ "eslint": "^7.0.0",
38
54
  "eslump": "^2.0.0",
39
- "mocha": "^7.1.2",
40
- "mochallel": "^2.0.0",
55
+ "esm": "^3.2.25",
56
+ "mocha": "^8.0.0",
41
57
  "pre-commit": "^1.2.2",
42
58
  "rimraf": "^3.0.0",
43
59
  "rollup": "2.0.6",
44
- "rollup-plugin-terser": "5.3.0",
45
60
  "semver": "^7.1.3"
46
61
  },
47
62
  "scripts": {
48
- "test": "npm run build -- --configTest && node test/run-tests.js",
49
- "test:compress": "npm run build -- --configTest && node test/compress.js",
50
- "test:mocha": "npm run build -- --configTest && node test/mocha.js",
63
+ "test": "node test/compress.js && mocha test/mocha",
64
+ "test:compress": "node test/compress.js",
65
+ "test:mocha": "mocha test/mocha",
51
66
  "lint": "eslint lib",
52
67
  "lint-fix": "eslint --fix lib",
53
- "build": "rimraf dist/* && rollup --config --silent",
68
+ "ls-lint": "ls-lint",
69
+ "build": "rimraf dist/bundle* && rollup --config --silent",
54
70
  "prepare": "npm run build",
55
71
  "postversion": "echo 'Remember to update the changelog!'"
56
72
  },
@@ -75,10 +91,13 @@
75
91
  ],
76
92
  "eslintConfig": {
77
93
  "parserOptions": {
78
- "sourceType": "module"
94
+ "sourceType": "module",
95
+ "ecmaVersion": "2020"
79
96
  },
80
97
  "env": {
81
- "es6": true
98
+ "node": true,
99
+ "browser": true,
100
+ "es2020": true
82
101
  },
83
102
  "globals": {
84
103
  "describe": false,
@@ -123,6 +142,7 @@
123
142
  },
124
143
  "pre-commit": [
125
144
  "lint-fix",
145
+ "ls-lint",
126
146
  "test"
127
147
  ]
128
148
  }
package/tools/exit.cjs ADDED
@@ -0,0 +1,7 @@
1
+ // workaround for tty output truncation upon process.exit()
2
+ // https://github.com/nodejs/node/issues/6456
3
+
4
+ [process.stdout, process.stderr].forEach((s) => {
5
+ s && s.isTTY && s._handle && s._handle.setBlocking &&
6
+ s._handle.setBlocking(true)
7
+ });