@node-minify/html-minifier 8.0.1-beta.0 → 8.0.2-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 CHANGED
@@ -6,13 +6,9 @@ import { MinifierOptions } from '@node-minify/types';
6
6
  * MIT Licensed
7
7
  */
8
8
 
9
- /**
10
- * Run html-minifier.
11
- *
12
- * @param {Object} settings
13
- * @param {String} content
14
- * @param {Function} callback
15
- */
16
- declare const minifyHTMLMinifier: ({ settings, content, callback, index }: MinifierOptions) => any;
9
+ declare const minifyHTMLMinifier: {
10
+ ({ settings, content, callback, index }: MinifierOptions): any;
11
+ default: any;
12
+ };
17
13
 
18
14
  export { minifyHTMLMinifier as default };
package/dist/index.js CHANGED
@@ -1,13 +1,10 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
8
  var __copyProps = (to, from, except, desc) => {
12
9
  if (from && typeof from === "object" || typeof from === "function") {
13
10
  for (let key of __getOwnPropNames(from))
@@ -20,14 +17,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
17
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
18
  mod
22
19
  ));
23
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
20
 
25
21
  // src/index.ts
26
- var src_exports = {};
27
- __export(src_exports, {
28
- default: () => src_default
29
- });
30
- module.exports = __toCommonJS(src_exports);
31
22
  var import_html_minifier = __toESM(require("html-minifier"));
32
23
  var import_utils = require("@node-minify/utils");
33
24
  var HTMLMinifier = import_html_minifier.default.minify;
@@ -59,9 +50,8 @@ var minifyHTMLMinifier = ({ settings, content, callback, index }) => {
59
50
  }
60
51
  return contentMinified;
61
52
  };
62
- var src_default = minifyHTMLMinifier;
63
- // Annotate the CommonJS export names for ESM import in node:
64
- 0 && (module.exports = {});
53
+ minifyHTMLMinifier.default = minifyHTMLMinifier;
54
+ module.exports = minifyHTMLMinifier;
65
55
  /*!
66
56
  * node-minify
67
57
  * Copyright(c) 2011-2022 Rodolphe Stoclin
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 minifier from 'html-minifier';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n// interface Options {\n// sourceMap?: boolean;\n// _sourceMap?: { url: string } | boolean;\n// }\n\n// interface Settings {\n// options: Options;\n// content: string;\n// output: string;\n// }\n\n// interface MinifierOptions {\n// settings: Settings;\n// content: string;\n// callback: Function;\n// index: number;\n// }\n\n/**\n * Module variables.\n */\nconst HTMLMinifier = minifier.minify;\nconst defaultOptions = {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n minifyCSS: true,\n minifyJS: true,\n removeAttributeQuotes: true,\n removeCDATASectionsFromCDATA: true,\n removeComments: true,\n removeCommentsFromCDATA: true,\n removeEmptyAttributes: true,\n removeOptionalTags: true,\n removeRedundantAttributes: true,\n removeScriptTypeAttributes: true,\n removeStyleLinkTypeAttributes: true,\n useShortDoctype: true\n};\n\n/**\n * Run html-minifier.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyHTMLMinifier = ({ settings, content, callback, index }: MinifierOptions) => {\n const options = Object.assign({}, defaultOptions, settings && settings.options);\n const contentMinified = HTMLMinifier(content || '', options);\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified, index });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyHTMLMinifier()`.\n */\nexport default minifyHTMLMinifier;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,2BAAqB;AACrB,mBAAsB;AAwBtB,IAAM,eAAe,qBAAAA,QAAS;AAC9B,IAAM,iBAAiB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,gBAAgB;AAAA,EAChB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,+BAA+B;AAAA,EAC/B,iBAAiB;AACnB;AASA,IAAM,qBAAqB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AACtF,QAAM,UAAU,OAAO,OAAO,CAAC,GAAG,gBAAgB,YAAY,SAAS,OAAO;AAC9E,QAAM,kBAAkB,aAAa,WAAW,IAAI,OAAO;AAC3D,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC5E;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,eAAe;AAAA,EACvC;AACA,SAAO;AACT;AAKA,IAAO,cAAQ;","names":["minifier"]}
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 minifier from 'html-minifier';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Module variables.\n */\nconst HTMLMinifier = minifier.minify;\nconst defaultOptions = {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n minifyCSS: true,\n minifyJS: true,\n removeAttributeQuotes: true,\n removeCDATASectionsFromCDATA: true,\n removeComments: true,\n removeCommentsFromCDATA: true,\n removeEmptyAttributes: true,\n removeOptionalTags: true,\n removeRedundantAttributes: true,\n removeScriptTypeAttributes: true,\n removeStyleLinkTypeAttributes: true,\n useShortDoctype: true\n};\n\n/**\n * Run html-minifier.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyHTMLMinifier = ({ settings, content, callback, index }: MinifierOptions) => {\n const options = Object.assign({}, defaultOptions, settings && settings.options);\n const contentMinified = HTMLMinifier(content || '', options);\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified, index });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyHTMLMinifier()`.\n */\nminifyHTMLMinifier.default = minifyHTMLMinifier;\nexport = minifyHTMLMinifier;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,2BAAqB;AACrB,mBAAsB;AAMtB,IAAM,eAAe,qBAAAA,QAAS;AAC9B,IAAM,iBAAiB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,gBAAgB;AAAA,EAChB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,+BAA+B;AAAA,EAC/B,iBAAiB;AACnB;AASA,IAAM,qBAAqB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AACtF,QAAM,UAAU,OAAO,OAAO,CAAC,GAAG,gBAAgB,YAAY,SAAS,OAAO;AAC9E,QAAM,kBAAkB,aAAa,WAAW,IAAI,OAAO;AAC3D,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC5E;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,eAAe;AAAA,EACvC;AACA,SAAO;AACT;AAKA,mBAAmB,UAAU;AAC7B,iBAAS;","names":["minifier"]}
package/dist/index.mjs CHANGED
@@ -1,39 +1,47 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __commonJS = (cb, mod) => function __require() {
3
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
+ };
5
+
1
6
  // src/index.ts
2
7
  import minifier from "html-minifier";
3
8
  import { utils } from "@node-minify/utils";
4
- var HTMLMinifier = minifier.minify;
5
- var defaultOptions = {
6
- collapseBooleanAttributes: true,
7
- collapseInlineTagWhitespace: true,
8
- collapseWhitespace: true,
9
- minifyCSS: true,
10
- minifyJS: true,
11
- removeAttributeQuotes: true,
12
- removeCDATASectionsFromCDATA: true,
13
- removeComments: true,
14
- removeCommentsFromCDATA: true,
15
- removeEmptyAttributes: true,
16
- removeOptionalTags: true,
17
- removeRedundantAttributes: true,
18
- removeScriptTypeAttributes: true,
19
- removeStyleLinkTypeAttributes: true,
20
- useShortDoctype: true
21
- };
22
- var minifyHTMLMinifier = ({ settings, content, callback, index }) => {
23
- const options = Object.assign({}, defaultOptions, settings && settings.options);
24
- const contentMinified = HTMLMinifier(content || "", options);
25
- if (settings && !settings.content) {
26
- utils.writeFile({ file: settings.output, content: contentMinified, index });
27
- }
28
- if (callback) {
29
- return callback(null, contentMinified);
9
+ var require_src = __commonJS({
10
+ "src/index.ts"(exports, module) {
11
+ var HTMLMinifier = minifier.minify;
12
+ var defaultOptions = {
13
+ collapseBooleanAttributes: true,
14
+ collapseInlineTagWhitespace: true,
15
+ collapseWhitespace: true,
16
+ minifyCSS: true,
17
+ minifyJS: true,
18
+ removeAttributeQuotes: true,
19
+ removeCDATASectionsFromCDATA: true,
20
+ removeComments: true,
21
+ removeCommentsFromCDATA: true,
22
+ removeEmptyAttributes: true,
23
+ removeOptionalTags: true,
24
+ removeRedundantAttributes: true,
25
+ removeScriptTypeAttributes: true,
26
+ removeStyleLinkTypeAttributes: true,
27
+ useShortDoctype: true
28
+ };
29
+ var minifyHTMLMinifier = ({ settings, content, callback, index }) => {
30
+ const options = Object.assign({}, defaultOptions, settings && settings.options);
31
+ const contentMinified = HTMLMinifier(content || "", options);
32
+ if (settings && !settings.content) {
33
+ utils.writeFile({ file: settings.output, content: contentMinified, index });
34
+ }
35
+ if (callback) {
36
+ return callback(null, contentMinified);
37
+ }
38
+ return contentMinified;
39
+ };
40
+ minifyHTMLMinifier.default = minifyHTMLMinifier;
41
+ module.exports = minifyHTMLMinifier;
30
42
  }
31
- return contentMinified;
32
- };
33
- var src_default = minifyHTMLMinifier;
34
- export {
35
- src_default as default
36
- };
43
+ });
44
+ export default require_src();
37
45
  /*!
38
46
  * node-minify
39
47
  * Copyright(c) 2011-2022 Rodolphe Stoclin
@@ -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 minifier from 'html-minifier';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n// interface Options {\n// sourceMap?: boolean;\n// _sourceMap?: { url: string } | boolean;\n// }\n\n// interface Settings {\n// options: Options;\n// content: string;\n// output: string;\n// }\n\n// interface MinifierOptions {\n// settings: Settings;\n// content: string;\n// callback: Function;\n// index: number;\n// }\n\n/**\n * Module variables.\n */\nconst HTMLMinifier = minifier.minify;\nconst defaultOptions = {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n minifyCSS: true,\n minifyJS: true,\n removeAttributeQuotes: true,\n removeCDATASectionsFromCDATA: true,\n removeComments: true,\n removeCommentsFromCDATA: true,\n removeEmptyAttributes: true,\n removeOptionalTags: true,\n removeRedundantAttributes: true,\n removeScriptTypeAttributes: true,\n removeStyleLinkTypeAttributes: true,\n useShortDoctype: true\n};\n\n/**\n * Run html-minifier.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyHTMLMinifier = ({ settings, content, callback, index }: MinifierOptions) => {\n const options = Object.assign({}, defaultOptions, settings && settings.options);\n const contentMinified = HTMLMinifier(content || '', options);\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified, index });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyHTMLMinifier()`.\n */\nexport default minifyHTMLMinifier;\n"],"mappings":";AASA,OAAO,cAAc;AACrB,SAAS,aAAa;AAwBtB,IAAM,eAAe,SAAS;AAC9B,IAAM,iBAAiB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,gBAAgB;AAAA,EAChB,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,+BAA+B;AAAA,EAC/B,iBAAiB;AACnB;AASA,IAAM,qBAAqB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AACtF,QAAM,UAAU,OAAO,OAAO,CAAC,GAAG,gBAAgB,YAAY,SAAS,OAAO;AAC9E,QAAM,kBAAkB,aAAa,WAAW,IAAI,OAAO;AAC3D,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,UAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC5E;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,eAAe;AAAA,EACvC;AACA,SAAO;AACT;AAKA,IAAO,cAAQ;","names":[]}
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 minifier from 'html-minifier';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Module variables.\n */\nconst HTMLMinifier = minifier.minify;\nconst defaultOptions = {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n minifyCSS: true,\n minifyJS: true,\n removeAttributeQuotes: true,\n removeCDATASectionsFromCDATA: true,\n removeComments: true,\n removeCommentsFromCDATA: true,\n removeEmptyAttributes: true,\n removeOptionalTags: true,\n removeRedundantAttributes: true,\n removeScriptTypeAttributes: true,\n removeStyleLinkTypeAttributes: true,\n useShortDoctype: true\n};\n\n/**\n * Run html-minifier.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyHTMLMinifier = ({ settings, content, callback, index }: MinifierOptions) => {\n const options = Object.assign({}, defaultOptions, settings && settings.options);\n const contentMinified = HTMLMinifier(content || '', options);\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified, index });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyHTMLMinifier()`.\n */\nminifyHTMLMinifier.default = minifyHTMLMinifier;\nexport = minifyHTMLMinifier;\n"],"mappings":";;;;;;AASA,OAAO,cAAc;AACrB,SAAS,aAAa;AAVtB;AAAA;AAgBA,QAAM,eAAe,SAAS;AAC9B,QAAM,iBAAiB;AAAA,MACrB,2BAA2B;AAAA,MAC3B,6BAA6B;AAAA,MAC7B,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX,UAAU;AAAA,MACV,uBAAuB;AAAA,MACvB,8BAA8B;AAAA,MAC9B,gBAAgB;AAAA,MAChB,yBAAyB;AAAA,MACzB,uBAAuB;AAAA,MACvB,oBAAoB;AAAA,MACpB,2BAA2B;AAAA,MAC3B,4BAA4B;AAAA,MAC5B,+BAA+B;AAAA,MAC/B,iBAAiB;AAAA,IACnB;AASA,QAAM,qBAAqB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AACtF,YAAM,UAAU,OAAO,OAAO,CAAC,GAAG,gBAAgB,YAAY,SAAS,OAAO;AAC9E,YAAM,kBAAkB,aAAa,WAAW,IAAI,OAAO;AAC3D,UAAI,YAAY,CAAC,SAAS,SAAS;AACjC,cAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,MAC5E;AACA,UAAI,UAAU;AACZ,eAAO,SAAS,MAAM,eAAe;AAAA,MACvC;AACA,aAAO;AAAA,IACT;AAKA,uBAAmB,UAAU;AAC7B,qBAAS;AAAA;AAAA;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-minify/html-minifier",
3
- "version": "8.0.1-beta.0",
3
+ "version": "8.0.2-beta.0",
4
4
  "description": "html-minifier plugin for @node-minify",
5
5
  "keywords": [
6
6
  "compressor",
@@ -45,12 +45,12 @@
45
45
  "prepublishOnly": "npm run build"
46
46
  },
47
47
  "dependencies": {
48
- "@node-minify/utils": "8.0.1-beta.0",
48
+ "@node-minify/utils": "8.0.2-beta.0",
49
49
  "html-minifier": "4.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@node-minify/types": "8.0.1-beta.0",
52
+ "@node-minify/types": "8.0.2-beta.0",
53
53
  "@types/html-minifier": "^4.0.2"
54
54
  },
55
- "gitHead": "35a8a41ec86a11cbec05d8a7db9113475ece2cef"
55
+ "gitHead": "bd2fe186257749fcb9bf7a9ff1ce61fb922c4ade"
56
56
  }