@node-minify/terser 6.4.0 → 7.1.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/lib/terser.js +1 -10
- package/package.json +5 -5
package/lib/terser.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _terser = _interopRequireDefault(require("terser"));
|
|
4
|
-
|
|
5
4
|
var _utils = require("@node-minify/utils");
|
|
6
|
-
|
|
7
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
|
|
9
6
|
/*!
|
|
10
7
|
* node-minify
|
|
11
8
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
|
@@ -31,13 +28,11 @@ const minifyTerser = async ({
|
|
|
31
28
|
}) => {
|
|
32
29
|
try {
|
|
33
30
|
const contentMinified = await _terser.default.minify(content, settings.options);
|
|
34
|
-
|
|
35
31
|
if (contentMinified.error) {
|
|
36
32
|
if (callback) {
|
|
37
33
|
return callback(contentMinified.error);
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
if (contentMinified.map && settings.options.sourceMap) {
|
|
42
37
|
_utils.utils.writeFile({
|
|
43
38
|
file: settings.options.sourceMap.url,
|
|
@@ -45,7 +40,6 @@ const minifyTerser = async ({
|
|
|
45
40
|
index
|
|
46
41
|
});
|
|
47
42
|
}
|
|
48
|
-
|
|
49
43
|
if (!settings.content) {
|
|
50
44
|
_utils.utils.writeFile({
|
|
51
45
|
file: settings.output,
|
|
@@ -53,19 +47,16 @@ const minifyTerser = async ({
|
|
|
53
47
|
index
|
|
54
48
|
});
|
|
55
49
|
}
|
|
56
|
-
|
|
57
50
|
if (callback) {
|
|
58
51
|
return callback(null, contentMinified.code);
|
|
59
52
|
}
|
|
60
|
-
|
|
61
53
|
return contentMinified.code;
|
|
62
54
|
} catch (error) {
|
|
63
55
|
return callback(error);
|
|
64
56
|
}
|
|
65
57
|
};
|
|
58
|
+
|
|
66
59
|
/**
|
|
67
60
|
* Expose `minifyTerser()`.
|
|
68
61
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
62
|
module.exports = minifyTerser;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/terser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "terser plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "lib/terser.js",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
16
|
+
"node": ">=14.0.0"
|
|
17
17
|
},
|
|
18
18
|
"directories": {
|
|
19
19
|
"lib": "lib",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"url": "https://github.com/srod/node-minify/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@node-minify/utils": "^
|
|
37
|
-
"terser": "5.
|
|
36
|
+
"@node-minify/utils": "^7.1.0",
|
|
37
|
+
"terser": "5.15.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "94cef2d5d653c3bddc3e603b4e25c135b0b6f4b3"
|
|
40
40
|
}
|