@node-minify/html-minifier 8.0.0-beta.0 → 8.0.1-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.js CHANGED
@@ -67,3 +67,4 @@ var src_default = minifyHTMLMinifier;
67
67
  * Copyright(c) 2011-2022 Rodolphe Stoclin
68
68
  * MIT Licensed
69
69
  */
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"]}
package/dist/index.mjs CHANGED
@@ -39,3 +39,4 @@ export {
39
39
  * Copyright(c) 2011-2022 Rodolphe Stoclin
40
40
  * MIT Licensed
41
41
  */
42
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-minify/html-minifier",
3
- "version": "8.0.0-beta.0",
3
+ "version": "8.0.1-beta.0",
4
4
  "description": "html-minifier plugin for @node-minify",
5
5
  "keywords": [
6
6
  "compressor",
@@ -41,16 +41,16 @@
41
41
  },
42
42
  "scripts": {
43
43
  "clean": "pnpm dlx rimraf dist",
44
- "build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean",
44
+ "build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
45
45
  "prepublishOnly": "npm run build"
46
46
  },
47
47
  "dependencies": {
48
- "@node-minify/utils": "8.0.0-beta.0",
48
+ "@node-minify/utils": "8.0.1-beta.0",
49
49
  "html-minifier": "4.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@node-minify/types": "8.0.0-beta.0",
52
+ "@node-minify/types": "8.0.1-beta.0",
53
53
  "@types/html-minifier": "^4.0.2"
54
54
  },
55
- "gitHead": "0507c6190577e1939997a8231b07952ba167a780"
55
+ "gitHead": "35a8a41ec86a11cbec05d8a7db9113475ece2cef"
56
56
  }