babel-plugin-template-html-minifier
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [4.1.0](https://github.com/cfware/babel-plugin-template-html-minifier/compare/v4.0.0...v4.1.0) (2020-04-07) | ||
### Features | ||
* Switch to html-minifier-terser ([#52](https://github.com/cfware/babel-plugin-template-html-minifier/issues/52)) ([f81fe58](https://github.com/cfware/babel-plugin-template-html-minifier/commit/f81fe58dd1d703782b5ae974cdf8322de06c7047)) | ||
## [4.0.0](https://github.com/cfware/babel-plugin-template-html-minifier/compare/v3.1.0...v4.0.0) (2020-01-26) | ||
@@ -7,0 +14,0 @@ |
'use strict'; | ||
const htmlMinifier = require('html-minifier'); | ||
const htmlMinifier = require('html-minifier-terser'); | ||
@@ -99,4 +99,4 @@ const cookRawQuasi = require('./cook-raw-quasi'); | ||
function handleStar(path, state, objName, optionsFilter) { | ||
const binding = path.scope.getBinding(objName); | ||
function handleStar(path, state, objectName, optionsFilter) { | ||
const binding = path.scope.getBinding(objectName); | ||
const bindings = state.bindings.filter(item => item.binding === binding && item.star === true && item.options.some(optionsFilter)); | ||
@@ -146,3 +146,3 @@ if (bindings.length === 1) { | ||
const majorDeleteError = 'html-minifier deleted something major, cannot proceed.'; | ||
const majorDeleteError = 'html-minifier-terser deleted something major, cannot proceed.'; | ||
module.exports = babel => { | ||
@@ -149,0 +149,0 @@ return { |
@@ -48,3 +48,3 @@ 'use strict'; | ||
case 'inline': | ||
matches = text.match(/^\*\{(?<text>[\s\S]*)\}$/); | ||
matches = text.match(/^\*{(?<text>[\s\S]*)}$/); | ||
break; | ||
@@ -51,0 +51,0 @@ case 'media': |
{ | ||
"name": "babel-plugin-template-html-minifier", | ||
"description": "Minify HTML in tagged template strings using html-minifier", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"main": "lib/index.js", | ||
@@ -9,3 +9,4 @@ "scripts": { | ||
"pretest": "xo", | ||
"test": "tap" | ||
"tests-only": "tap", | ||
"test": "npm run -s tests-only" | ||
}, | ||
@@ -34,3 +35,3 @@ "repository": { | ||
"clean-css": "^4.2.1", | ||
"html-minifier": "^4.0.0", | ||
"html-minifier-terser": "^5.0.0", | ||
"is-builtin-module": "^3.0.0" | ||
@@ -47,3 +48,3 @@ }, | ||
"tap": "^14.10.6", | ||
"xo": "^0.25.3" | ||
"xo": "^0.28.0" | ||
}, | ||
@@ -55,2 +56,5 @@ "xo": { | ||
], | ||
"rules": { | ||
"unicorn/string-content": 0 | ||
}, | ||
"overrides": [ | ||
@@ -57,0 +61,0 @@ { |
@@ -9,3 +9,3 @@ # babel-plugin-template-html-minifier | ||
Minify HTML in tagged template strings using [html-minifier](https://github.com/kangax/html-minifier). | ||
Minify HTML in tagged template strings using [html-minifier-terser](https://github.com/DanielRuf/html-minifier-terser). | ||
@@ -58,2 +58,3 @@ ## Install | ||
"caseSensitive": true, | ||
"minifyCSS": true | ||
}, | ||
@@ -69,4 +70,4 @@ }] | ||
The value of this property is passed unmodified to html-minifier. See the | ||
[html-minifier docs](https://github.com/kangax/html-minifier#options-quick-reference). | ||
The value of this property is passed unmodified to html-minifier-terser. See the | ||
[html-minifier-terser docs](https://github.com/DanielRuf/html-minifier-terser#options-quick-reference). | ||
@@ -87,3 +88,3 @@ Note for usage with `lit-html` and `lit-element`: | ||
This exception is for two reasons. First because it means the chosen options have | ||
caused `html-minifier` to change the meaning of the HTML template. Second because | ||
caused `html-minifier-terser` to change the meaning of the HTML template. Second because | ||
it deletes the point where `${readonly}` goes into the final output. | ||
@@ -250,3 +251,3 @@ | ||
* css is processed because `"lit-element": [{"name": "css", "encapsulation": "style"}]`. | ||
The `encapsulation` argument ensures that `html-minifier` understands that the template | ||
The `encapsulation` argument ensures that `html-minifier-terser` understands that the template | ||
contains CSS, without it the template would be processed as HTML. | ||
@@ -253,0 +254,0 @@ * `this.html` in MyHyperHTMLElement is processed because |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27068
289
+ Addedhtml-minifier-terser@^5.0.0
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcamel-case@4.1.2(transitive)
+ Addedcommander@4.1.1(transitive)
+ Addeddot-case@3.0.4(transitive)
+ Addedhtml-minifier-terser@5.1.1(transitive)
+ Addedlower-case@2.0.2(transitive)
+ Addedno-case@3.0.4(transitive)
+ Addedparam-case@3.0.4(transitive)
+ Addedpascal-case@3.1.2(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedterser@4.8.1(transitive)
+ Addedtslib@2.8.1(transitive)
- Removedhtml-minifier@^4.0.0
- Removedcamel-case@3.0.0(transitive)
- Removedhtml-minifier@4.0.0(transitive)
- Removedlower-case@1.1.4(transitive)
- Removedno-case@2.3.2(transitive)
- Removedparam-case@2.1.1(transitive)
- Removeduglify-js@3.19.3(transitive)
- Removedupper-case@1.1.3(transitive)