Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-template-html-minifier

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-template-html-minifier - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

7

CHANGELOG.md

@@ -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 @@

8

lib/index.js
'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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc