@node-minify/uglify-es 8.0.5-beta.0 → 8.0.6
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/README.md +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p align="center"><img src="/static/node-minify.
|
|
1
|
+
<p align="center"><img src="/static/node-minify.svg" width="348" alt="node-minify"></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">A very light minifier Node.js module.</p>
|
|
4
4
|
|
|
@@ -32,7 +32,7 @@ minify({
|
|
|
32
32
|
compressor: uglifyES,
|
|
33
33
|
input: 'foo.js',
|
|
34
34
|
output: 'bar.js',
|
|
35
|
-
callback: function(err, min) {}
|
|
35
|
+
callback: function (err, min) {}
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MinifierOptions
|
|
1
|
+
import { MinifierOptions } from '@node-minify/types';
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* node-minify
|
|
@@ -6,19 +6,19 @@ import { MinifierOptions, Settings, Options } from '@node-minify/types';
|
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type OptionsUglifyES = {
|
|
10
10
|
sourceMap?: {
|
|
11
11
|
filename: string;
|
|
12
12
|
};
|
|
13
|
-
}
|
|
14
|
-
|
|
13
|
+
};
|
|
14
|
+
type SettingsUglifyES = {
|
|
15
15
|
options: OptionsUglifyES;
|
|
16
|
-
}
|
|
17
|
-
|
|
16
|
+
};
|
|
17
|
+
type MinifierOptionsUglifyES = {
|
|
18
18
|
settings: SettingsUglifyES;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
declare const minifyUglifyES: {
|
|
21
|
-
({ settings, content, callback, index }: MinifierOptionsUglifyES): string | void;
|
|
21
|
+
({ settings, content, callback, index }: MinifierOptions & MinifierOptionsUglifyES): string | void;
|
|
22
22
|
default: any;
|
|
23
23
|
};
|
|
24
24
|
|
package/dist/index.js
CHANGED
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
var import_uglify_es = __toESM(require("uglify-es"));
|
|
27
27
|
var import_utils = require("@node-minify/utils");
|
|
28
28
|
var minifyUglifyES = ({ settings, content, callback, index }) => {
|
|
29
|
-
let content2 = content
|
|
30
|
-
if (
|
|
31
|
-
content2 = { [settings.options.sourceMap.filename
|
|
29
|
+
let content2 = content ?? "";
|
|
30
|
+
if (typeof settings.options.sourceMap === "object") {
|
|
31
|
+
content2 = { [settings.options.sourceMap.filename ?? ""]: content ?? "" };
|
|
32
32
|
}
|
|
33
|
-
const contentMinified = import_uglify_es.default.minify(content2, settings
|
|
33
|
+
const contentMinified = import_uglify_es.default.minify(content2, settings.options);
|
|
34
34
|
if (contentMinified.error) {
|
|
35
35
|
if (callback) {
|
|
36
36
|
return callback(contentMinified.error);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
if (contentMinified.map && settings
|
|
39
|
+
if (contentMinified.map && settings.options.sourceMap) {
|
|
40
40
|
import_utils.utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });
|
|
41
41
|
}
|
|
42
42
|
if (settings && !settings.content && settings.output) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport uglifyES from 'uglify-es';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport uglifyES from 'uglify-es';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions, Dictionary } from '@node-minify/types';\n\ntype OptionsUglifyES = {\n sourceMap?: { filename: string };\n};\n\ntype SettingsUglifyES = {\n options: OptionsUglifyES;\n};\n\ntype MinifierOptionsUglifyES = {\n settings: SettingsUglifyES;\n};\n\n/**\n * Run uglifyES.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyUglifyES = ({ settings, content, callback, index }: MinifierOptions & MinifierOptionsUglifyES) => {\n let content2: string | Dictionary<string> = content ?? '';\n if (typeof settings.options.sourceMap === 'object') {\n content2 = { [settings.options.sourceMap.filename ?? '']: content ?? '' };\n }\n const contentMinified = uglifyES.minify(content2, settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings.options.sourceMap) {\n utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });\n }\n if (settings && !settings.content && settings.output) {\n utils.writeFile({ file: settings.output, content: contentMinified.code, index });\n }\n if (callback) {\n return callback(null, contentMinified.code);\n }\n return contentMinified.code;\n};\n\n/**\n * Expose `minifyUglifyES()`.\n */\nminifyUglifyES.default = minifyUglifyES;\nexport = minifyUglifyES;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,uBAAqB;AACrB,mBAAsB;AAsBtB,IAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAiD;AAC5G,MAAI,WAAwC,WAAW;AACvD,MAAI,OAAO,SAAS,QAAQ,cAAc,UAAU;AAClD,eAAW,EAAE,CAAC,SAAS,QAAQ,UAAU,YAAY,EAAE,GAAG,WAAW,GAAG;AAAA,EAC1E;AACA,QAAM,kBAAkB,iBAAAA,QAAS,OAAO,UAAU,SAAS,OAAO;AAClE,MAAI,gBAAgB,OAAO;AACzB,QAAI,UAAU;AACZ,aAAO,SAAS,gBAAgB,KAAK;AAAA,IACvC;AAAA,EACF;AACA,MAAI,gBAAgB,OAAO,SAAS,QAAQ,WAAW;AACrD,uBAAM,UAAU,EAAE,MAAM,GAAG,SAAS,cAAc,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,EACzF;AACA,MAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,MAAM,MAAM,CAAC;AAAA,EACjF;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,gBAAgB,IAAI;AAAA,EAC5C;AACA,SAAO,gBAAgB;AACzB;AAKA,eAAe,UAAU;AACzB,iBAAS;","names":["uglifyES"]}
|
package/dist/index.mjs
CHANGED
|
@@ -9,17 +9,17 @@ import { utils } from "@node-minify/utils";
|
|
|
9
9
|
var require_src = __commonJS({
|
|
10
10
|
"src/index.ts"(exports, module) {
|
|
11
11
|
var minifyUglifyES = ({ settings, content, callback, index }) => {
|
|
12
|
-
let content2 = content
|
|
13
|
-
if (
|
|
14
|
-
content2 = { [settings.options.sourceMap.filename
|
|
12
|
+
let content2 = content ?? "";
|
|
13
|
+
if (typeof settings.options.sourceMap === "object") {
|
|
14
|
+
content2 = { [settings.options.sourceMap.filename ?? ""]: content ?? "" };
|
|
15
15
|
}
|
|
16
|
-
const contentMinified = uglifyES.minify(content2, settings
|
|
16
|
+
const contentMinified = uglifyES.minify(content2, settings.options);
|
|
17
17
|
if (contentMinified.error) {
|
|
18
18
|
if (callback) {
|
|
19
19
|
return callback(contentMinified.error);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
if (contentMinified.map && settings
|
|
22
|
+
if (contentMinified.map && settings.options.sourceMap) {
|
|
23
23
|
utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });
|
|
24
24
|
}
|
|
25
25
|
if (settings && !settings.content && settings.output) {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport uglifyES from 'uglify-es';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport uglifyES from 'uglify-es';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions, Dictionary } from '@node-minify/types';\n\ntype OptionsUglifyES = {\n sourceMap?: { filename: string };\n};\n\ntype SettingsUglifyES = {\n options: OptionsUglifyES;\n};\n\ntype MinifierOptionsUglifyES = {\n settings: SettingsUglifyES;\n};\n\n/**\n * Run uglifyES.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyUglifyES = ({ settings, content, callback, index }: MinifierOptions & MinifierOptionsUglifyES) => {\n let content2: string | Dictionary<string> = content ?? '';\n if (typeof settings.options.sourceMap === 'object') {\n content2 = { [settings.options.sourceMap.filename ?? '']: content ?? '' };\n }\n const contentMinified = uglifyES.minify(content2, settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings.options.sourceMap) {\n utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });\n }\n if (settings && !settings.content && settings.output) {\n utils.writeFile({ file: settings.output, content: contentMinified.code, index });\n }\n if (callback) {\n return callback(null, contentMinified.code);\n }\n return contentMinified.code;\n};\n\n/**\n * Expose `minifyUglifyES()`.\n */\nminifyUglifyES.default = minifyUglifyES;\nexport = minifyUglifyES;\n"],"mappings":";;;;;;AASA,OAAO,cAAc;AACrB,SAAS,aAAa;AAVtB;AAAA;AAgCA,QAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAiD;AAC5G,UAAI,WAAwC,WAAW;AACvD,UAAI,OAAO,SAAS,QAAQ,cAAc,UAAU;AAClD,mBAAW,EAAE,CAAC,SAAS,QAAQ,UAAU,YAAY,EAAE,GAAG,WAAW,GAAG;AAAA,MAC1E;AACA,YAAM,kBAAkB,SAAS,OAAO,UAAU,SAAS,OAAO;AAClE,UAAI,gBAAgB,OAAO;AACzB,YAAI,UAAU;AACZ,iBAAO,SAAS,gBAAgB,KAAK;AAAA,QACvC;AAAA,MACF;AACA,UAAI,gBAAgB,OAAO,SAAS,QAAQ,WAAW;AACrD,cAAM,UAAU,EAAE,MAAM,GAAG,SAAS,cAAc,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,MACzF;AACA,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,cAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,MAAM,MAAM,CAAC;AAAA,MACjF;AACA,UAAI,UAAU;AACZ,eAAO,SAAS,MAAM,gBAAgB,IAAI;AAAA,MAC5C;AACA,aAAO,gBAAgB;AAAA,IACzB;AAKA,mBAAe,UAAU;AACzB,qBAAS;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/uglify-es",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.6",
|
|
4
4
|
"description": "uglify-es plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"prepublishOnly": "pnpm build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
48
|
+
"@node-minify/utils": "8.0.6",
|
|
49
49
|
"uglify-es": "3.3.9"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.6",
|
|
53
53
|
"@types/uglify-es": "^3.0.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "9fb532af458cb6416ecfb7abfb9cc0a3b9cb42e1"
|
|
56
56
|
}
|