@node-minify/uglify-es 8.0.2-beta.0 → 8.0.3-beta.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/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface MinifierOptionsUglifyES extends Omit<MinifierOptions, 'settings'> {
|
|
|
18
18
|
settings: SettingsUglifyES;
|
|
19
19
|
}
|
|
20
20
|
declare const minifyUglifyES: {
|
|
21
|
-
({ settings, content, callback, index }: MinifierOptionsUglifyES):
|
|
21
|
+
({ settings, content, callback, index }: MinifierOptionsUglifyES): string | void;
|
|
22
22
|
default: any;
|
|
23
23
|
};
|
|
24
24
|
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
@@ -35,7 +39,7 @@ var minifyUglifyES = ({ settings, content, callback, index }) => {
|
|
|
35
39
|
if (contentMinified.map && settings && settings.options.sourceMap) {
|
|
36
40
|
import_utils.utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });
|
|
37
41
|
}
|
|
38
|
-
if (settings && !settings.content) {
|
|
42
|
+
if (settings && !settings.content && settings.output) {
|
|
39
43
|
import_utils.utils.writeFile({ file: settings.output, content: contentMinified.code, index });
|
|
40
44
|
}
|
|
41
45
|
if (callback) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 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, Options, Settings, Dictionary } from '@node-minify/types';\n\ninterface OptionsUglifyES extends Omit<Options, 'sourceMap'> {\n sourceMap?: { filename: string };\n}\n\ninterface SettingsUglifyES extends Omit<Settings, 'options'> {\n options: OptionsUglifyES;\n}\n\ninterface MinifierOptionsUglifyES extends Omit<MinifierOptions, 'settings'> {\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 }: MinifierOptionsUglifyES) => {\n let content2: string | Dictionary<string> = content || '';\n if (settings && typeof settings.options.sourceMap === 'object') {\n content2 = { [settings.options.sourceMap.filename || '']: content || '' };\n }\n const contentMinified = uglifyES.minify(content2, settings && settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings && settings.options.sourceMap) {\n utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });\n }\n if (settings && !settings.content) {\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":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 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, Options, Settings, Dictionary } from '@node-minify/types';\n\ninterface OptionsUglifyES extends Omit<Options, 'sourceMap'> {\n sourceMap?: { filename: string };\n}\n\ninterface SettingsUglifyES extends Omit<Settings, 'options'> {\n options: OptionsUglifyES;\n}\n\ninterface MinifierOptionsUglifyES extends Omit<MinifierOptions, 'settings'> {\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 }: MinifierOptionsUglifyES) => {\n let content2: string | Dictionary<string> = content || '';\n if (settings && typeof settings.options.sourceMap === 'object') {\n content2 = { [settings.options.sourceMap.filename || '']: content || '' };\n }\n const contentMinified = uglifyES.minify(content2, settings && settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings && 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,MAA+B;AAC1F,MAAI,WAAwC,WAAW;AACvD,MAAI,YAAY,OAAO,SAAS,QAAQ,cAAc,UAAU;AAC9D,eAAW,EAAE,CAAC,SAAS,QAAQ,UAAU,YAAY,EAAE,GAAG,WAAW,GAAG;AAAA,EAC1E;AACA,QAAM,kBAAkB,iBAAAA,QAAS,OAAO,UAAU,YAAY,SAAS,OAAO;AAC9E,MAAI,gBAAgB,OAAO;AACzB,QAAI,UAAU;AACZ,aAAO,SAAS,gBAAgB,KAAK;AAAA,IACvC;AAAA,EACF;AACA,MAAI,gBAAgB,OAAO,YAAY,SAAS,QAAQ,WAAW;AACjE,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
|
@@ -22,7 +22,7 @@ var require_src = __commonJS({
|
|
|
22
22
|
if (contentMinified.map && settings && settings.options.sourceMap) {
|
|
23
23
|
utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });
|
|
24
24
|
}
|
|
25
|
-
if (settings && !settings.content) {
|
|
25
|
+
if (settings && !settings.content && settings.output) {
|
|
26
26
|
utils.writeFile({ file: settings.output, content: contentMinified.code, index });
|
|
27
27
|
}
|
|
28
28
|
if (callback) {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 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, Options, Settings, Dictionary } from '@node-minify/types';\n\ninterface OptionsUglifyES extends Omit<Options, 'sourceMap'> {\n sourceMap?: { filename: string };\n}\n\ninterface SettingsUglifyES extends Omit<Settings, 'options'> {\n options: OptionsUglifyES;\n}\n\ninterface MinifierOptionsUglifyES extends Omit<MinifierOptions, 'settings'> {\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 }: MinifierOptionsUglifyES) => {\n let content2: string | Dictionary<string> = content || '';\n if (settings && typeof settings.options.sourceMap === 'object') {\n content2 = { [settings.options.sourceMap.filename || '']: content || '' };\n }\n const contentMinified = uglifyES.minify(content2, settings && settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings && settings.options.sourceMap) {\n utils.writeFile({ file: `${settings.output}.map`, content: contentMinified.map, index });\n }\n if (settings && !settings.content) {\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,MAA+B;AAC1F,UAAI,WAAwC,WAAW;AACvD,UAAI,YAAY,OAAO,SAAS,QAAQ,cAAc,UAAU;AAC9D,mBAAW,EAAE,CAAC,SAAS,QAAQ,UAAU,YAAY,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 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, Options, Settings, Dictionary } from '@node-minify/types';\n\ninterface OptionsUglifyES extends Omit<Options, 'sourceMap'> {\n sourceMap?: { filename: string };\n}\n\ninterface SettingsUglifyES extends Omit<Settings, 'options'> {\n options: OptionsUglifyES;\n}\n\ninterface MinifierOptionsUglifyES extends Omit<MinifierOptions, 'settings'> {\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 }: MinifierOptionsUglifyES) => {\n let content2: string | Dictionary<string> = content || '';\n if (settings && typeof settings.options.sourceMap === 'object') {\n content2 = { [settings.options.sourceMap.filename || '']: content || '' };\n }\n const contentMinified = uglifyES.minify(content2, settings && settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings && 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,MAA+B;AAC1F,UAAI,WAAwC,WAAW;AACvD,UAAI,YAAY,OAAO,SAAS,QAAQ,cAAc,UAAU;AAC9D,mBAAW,EAAE,CAAC,SAAS,QAAQ,UAAU,YAAY,EAAE,GAAG,WAAW,GAAG;AAAA,MAC1E;AACA,YAAM,kBAAkB,SAAS,OAAO,UAAU,YAAY,SAAS,OAAO;AAC9E,UAAI,gBAAgB,OAAO;AACzB,YAAI,UAAU;AACZ,iBAAO,SAAS,gBAAgB,KAAK;AAAA,QACvC;AAAA,MACF;AACA,UAAI,gBAAgB,OAAO,YAAY,SAAS,QAAQ,WAAW;AACjE,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.3-beta.0",
|
|
4
4
|
"description": "uglify-es plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"homepage": "https://github.com/srod/node-minify/tree/master/packages/uglify-es#readme",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"directories": {
|
|
18
18
|
"lib": "dist",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"clean": "pnpm dlx rimraf dist",
|
|
44
|
-
"build": "
|
|
45
|
-
"prepublishOnly": "
|
|
44
|
+
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
|
|
45
|
+
"prepublishOnly": "pnpm build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
48
|
+
"@node-minify/utils": "8.0.3-beta.0",
|
|
49
49
|
"uglify-es": "3.3.9"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.3-beta.0",
|
|
53
53
|
"@types/uglify-es": "^3.0.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f79e146eed24ca117756cf029eb5005631f12892"
|
|
56
56
|
}
|