@node-minify/terser 8.0.5 → 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/dist/index.d.ts +8 -8
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
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 OptionsTerser = {
|
|
10
10
|
sourceMap?: {
|
|
11
11
|
url: string;
|
|
12
12
|
};
|
|
13
|
-
}
|
|
14
|
-
|
|
13
|
+
};
|
|
14
|
+
type SettingsTerser = {
|
|
15
15
|
options: OptionsTerser;
|
|
16
|
-
}
|
|
17
|
-
|
|
16
|
+
};
|
|
17
|
+
type MinifierOptionsTerser = {
|
|
18
18
|
settings: SettingsTerser;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
declare const minifyTerser: {
|
|
21
|
-
({ settings, content, callback, index }: MinifierOptionsTerser): Promise<string | void | null>;
|
|
21
|
+
({ settings, content, callback, index }: MinifierOptions & MinifierOptionsTerser): Promise<string | void | null>;
|
|
22
22
|
default: any;
|
|
23
23
|
};
|
|
24
24
|
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@ var import_terser = require("terser");
|
|
|
5
5
|
var import_utils = require("@node-minify/utils");
|
|
6
6
|
var minifyTerser = async ({ settings, content, callback, index }) => {
|
|
7
7
|
try {
|
|
8
|
-
const contentMinified = await (0, import_terser.minify)(content
|
|
9
|
-
if (contentMinified.map &&
|
|
8
|
+
const contentMinified = await (0, import_terser.minify)(content ?? "", settings?.options);
|
|
9
|
+
if (contentMinified.map && typeof settings?.options?.sourceMap?.url === "string") {
|
|
10
10
|
import_utils.utils.writeFile({ file: settings.options.sourceMap.url, content: contentMinified.map, index });
|
|
11
11
|
}
|
|
12
12
|
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 { minify } from 'terser';\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 { minify } from 'terser';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\ntype OptionsTerser = {\n sourceMap?: { url: string };\n};\n\ntype SettingsTerser = {\n options: OptionsTerser;\n};\n\ntype MinifierOptionsTerser = {\n settings: SettingsTerser;\n};\n\n/**\n * Run terser.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyTerser = async ({ settings, content, callback, index }: MinifierOptions & MinifierOptionsTerser) => {\n try {\n const contentMinified = await minify(content ?? '', settings?.options);\n if (contentMinified.map && typeof settings?.options?.sourceMap?.url === 'string') {\n utils.writeFile({ file: settings.options.sourceMap.url, 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 } catch (error) {\n return callback && callback(error);\n }\n};\n\n/**\n * Expose `minifyTerser()`.\n */\nminifyTerser.default = minifyTerser;\nexport = minifyTerser;\n"],"mappings":";;;AASA,oBAAuB;AACvB,mBAAsB;AAsBtB,IAAM,eAAe,OAAO,EAAE,UAAU,SAAS,UAAU,MAAM,MAA+C;AAC9G,MAAI;AACF,UAAM,kBAAkB,UAAM,sBAAO,WAAW,IAAI,UAAU,OAAO;AACrE,QAAI,gBAAgB,OAAO,OAAO,UAAU,SAAS,WAAW,QAAQ,UAAU;AAChF,yBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,UAAU,KAAK,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,IAC/F;AACA,QAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,yBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,MAAM,MAAM,CAAC;AAAA,IACjF;AACA,QAAI,UAAU;AACZ,aAAO,SAAS,MAAM,gBAAgB,IAAI;AAAA,IAC5C;AACA,WAAO,gBAAgB;AAAA,EACzB,SAAS,OAAP;AACA,WAAO,YAAY,SAAS,KAAK;AAAA,EACnC;AACF;AAKA,aAAa,UAAU;AACvB,iBAAS;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -10,8 +10,8 @@ var require_src = __commonJS({
|
|
|
10
10
|
"src/index.ts"(exports, module) {
|
|
11
11
|
var minifyTerser = async ({ settings, content, callback, index }) => {
|
|
12
12
|
try {
|
|
13
|
-
const contentMinified = await minify(content
|
|
14
|
-
if (contentMinified.map &&
|
|
13
|
+
const contentMinified = await minify(content ?? "", settings?.options);
|
|
14
|
+
if (contentMinified.map && typeof settings?.options?.sourceMap?.url === "string") {
|
|
15
15
|
utils.writeFile({ file: settings.options.sourceMap.url, content: contentMinified.map, index });
|
|
16
16
|
}
|
|
17
17
|
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 { minify } from 'terser';\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 { minify } from 'terser';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\ntype OptionsTerser = {\n sourceMap?: { url: string };\n};\n\ntype SettingsTerser = {\n options: OptionsTerser;\n};\n\ntype MinifierOptionsTerser = {\n settings: SettingsTerser;\n};\n\n/**\n * Run terser.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyTerser = async ({ settings, content, callback, index }: MinifierOptions & MinifierOptionsTerser) => {\n try {\n const contentMinified = await minify(content ?? '', settings?.options);\n if (contentMinified.map && typeof settings?.options?.sourceMap?.url === 'string') {\n utils.writeFile({ file: settings.options.sourceMap.url, 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 } catch (error) {\n return callback && callback(error);\n }\n};\n\n/**\n * Expose `minifyTerser()`.\n */\nminifyTerser.default = minifyTerser;\nexport = minifyTerser;\n"],"mappings":";;;;;;AASA,SAAS,cAAc;AACvB,SAAS,aAAa;AAVtB;AAAA;AAgCA,QAAM,eAAe,OAAO,EAAE,UAAU,SAAS,UAAU,MAAM,MAA+C;AAC9G,UAAI;AACF,cAAM,kBAAkB,MAAM,OAAO,WAAW,IAAI,UAAU,OAAO;AACrE,YAAI,gBAAgB,OAAO,OAAO,UAAU,SAAS,WAAW,QAAQ,UAAU;AAChF,gBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,UAAU,KAAK,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,QAC/F;AACA,YAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,gBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,MAAM,MAAM,CAAC;AAAA,QACjF;AACA,YAAI,UAAU;AACZ,iBAAO,SAAS,MAAM,gBAAgB,IAAI;AAAA,QAC5C;AACA,eAAO,gBAAgB;AAAA,MACzB,SAAS,OAAP;AACA,eAAO,YAAY,SAAS,KAAK;AAAA,MACnC;AAAA,IACF;AAKA,iBAAa,UAAU;AACvB,qBAAS;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/terser",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.6",
|
|
4
4
|
"description": "terser plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"prepublishOnly": "pnpm build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
49
|
-
"terser": "5.16.
|
|
48
|
+
"@node-minify/utils": "8.0.6",
|
|
49
|
+
"terser": "5.16.9"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.6"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "9fb532af458cb6416ecfb7abfb9cc0a3b9cb42e1"
|
|
55
55
|
}
|