terser 3.14.0-beta → 3.16.1

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/package.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "homepage": "https://github.com/fabiosantoscode/terser",
5
5
  "author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
6
6
  "license": "BSD-2-Clause",
7
- "version": "3.14.0-beta",
7
+ "version": "3.16.1",
8
8
  "engines": {
9
- "node": ">=0.8.0"
9
+ "node": ">=6.0.0"
10
10
  },
11
11
  "maintainers": [
12
12
  "Fábio Santos <fabiosantosart@gmail.com>",
@@ -14,45 +14,51 @@
14
14
  "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)"
15
15
  ],
16
16
  "repository": "https://github.com/fabiosantoscode/terser.git",
17
- "main": "dist/bundle.js",
17
+ "main": "dist/bundle.min.js",
18
18
  "types": "tools/terser.d.ts",
19
19
  "bin": {
20
20
  "terser": "bin/uglifyjs"
21
21
  },
22
22
  "files": [
23
23
  "bin",
24
- "lib",
25
24
  "dist",
26
25
  "!dist/bundle.instrumented.js",
27
26
  "tools",
28
- "LICENSE"
27
+ "LICENSE",
28
+ "README.md",
29
+ "CHANGELOG.md",
30
+ "PATRONS.md"
29
31
  ],
30
32
  "dependencies": {
31
33
  "commander": "~2.17.1",
32
34
  "source-map": "~0.6.1",
33
- "source-map-support": "~0.5.6"
35
+ "source-map-support": "~0.5.9"
34
36
  },
35
37
  "devDependencies": {
36
38
  "acorn": "^6.0.4",
37
39
  "coveralls": "^3.0.2",
38
- "csv": "^5.0.0",
40
+ "cross-env": "^5.2.0",
41
+ "csv": "^5.1.0",
39
42
  "es6-promise": "^4.2.5",
40
- "escodegen": "^1.9.1",
43
+ "escodegen": "^1.11.0",
41
44
  "eslint": "^4.19.1",
42
45
  "eslump": "^2.0.0",
43
46
  "istanbul": "^0.4.5",
44
47
  "mocha": "^3.0.0",
45
- "mochallel": "^1.8.2",
48
+ "mochallel": "^1.8.6",
46
49
  "pre-commit": "^1.2.2",
47
- "semver": "~5.5.0"
50
+ "rimraf": "^2.6.2",
51
+ "rollup": "^1.0.1",
52
+ "semver": "~5.5.1"
48
53
  },
49
54
  "scripts": {
50
- "test": "rm -f dist/* && npm run prepare && istanbul instrument dist/bundle.js > dist/bundle.instrumented.js && node test/run-tests.js",
55
+ "test": "rimraf dist/* && npm run prepare && istanbul instrument dist/bundle.min.js > dist/bundle.instrumented.js && node test/run-tests.js",
51
56
  "coverage": "istanbul cover test/run-tests.js",
52
57
  "coveralls": "coveralls < coverage/lcov.info",
53
58
  "lint": "eslint lib",
54
59
  "lint-fix": "eslint --fix lib",
55
- "prepare": "cd dist && TERSER_NO_BUNDLE=1 ../bin/uglifyjs ../tools/domprops.js ../lib/utils.js ../lib/ast.js ../lib/parse.js ../lib/transform.js ../lib/scope.js ../lib/output.js ../lib/compress.js ../lib/sourcemap.js ../lib/mozilla-ast.js ../lib/propmangle.js ../lib/minify.js ../tools/exports.js -mc -d \"MOZ_SourceMap=require('source-map')\" --source-map \"includeSources=true,url='bundle.js.map'\" -e \"exports:(typeof module != 'undefined' ? module.exports : Terser = {})\" -b beautify=false,ascii_only --comments /license/ -o ../dist/bundle.js"
60
+ "prepare": "rollup -c && cd dist && cross-env TERSER_NO_BUNDLE=1 ../bin/uglifyjs bundle.js -mc --source-map 'content=bundle.js.map,includeSources=true,url=bundle.min.js.map' -o bundle.min.js",
61
+ "postversion": "echo 'Remember to update the changelog!'"
56
62
  },
57
63
  "keywords": [
58
64
  "uglify",
@@ -74,6 +80,9 @@
74
80
  "await"
75
81
  ],
76
82
  "eslintConfig": {
83
+ "parserOptions": {
84
+ "sourceType": "module"
85
+ },
77
86
  "rules": {
78
87
  "brace-style": [
79
88
  "error",
@@ -88,6 +97,7 @@
88
97
  "avoid-escape"
89
98
  ],
90
99
  "no-debugger": "error",
100
+ "no-undef": "error",
91
101
  "semi": [
92
102
  "error",
93
103
  "always"
package/tools/domprops.js CHANGED
@@ -1,4 +1,4 @@
1
- var domprops = [
1
+ export var domprops = [
2
2
  "$&",
3
3
  "$'",
4
4
  "$*",
package/tools/node.js CHANGED
@@ -1,41 +1,8 @@
1
1
  var fs = require("fs");
2
2
 
3
- var UglifyJS = exports;
4
- var FILES = UglifyJS.FILES = [
5
- "./domprops.js",
6
- "../lib/utils.js",
7
- "../lib/ast.js",
8
- "../lib/parse.js",
9
- "../lib/transform.js",
10
- "../lib/scope.js",
11
- "../lib/output.js",
12
- "../lib/compress.js",
13
- "../lib/sourcemap.js",
14
- "../lib/mozilla-ast.js",
15
- "../lib/propmangle.js",
16
- "../lib/minify.js",
17
- "./exports.js",
18
- ].map(function(file){
19
- return require.resolve(file);
20
- });
21
-
22
- try {
23
- var istanbul = require("istanbul");
24
- var instrumenter = new istanbul.Instrumenter();
25
- } catch (ex) {}
26
-
27
- new Function("MOZ_SourceMap", "exports", "require", function() {
28
- var code = FILES.map(function(file) {
29
- var contents = fs.readFileSync(file, "utf8");
30
- if (instrumenter && global.__IS_TESTING__) return instrumenter.instrumentSync(contents, file);
31
- return contents;
32
- });
33
- return code.join("\n\n");
34
- }())(
35
- require("source-map"),
36
- UglifyJS,
37
- require
38
- );
3
+ var bundle_path = __dirname + "/../dist/bundle.js";
4
+ var UglifyJS = require(bundle_path);
5
+ module.exports = UglifyJS;
39
6
 
40
7
  function infer_options(options) {
41
8
  var result = UglifyJS.minify("", options);