babel-plugin-template-html-minifier
Advanced tools
Comparing version 2.0.0 to 2.0.1
const htmlMinifier = require('html-minifier'); | ||
const isBuiltinModule = require('is-builtin-module'); | ||
@@ -24,2 +25,8 @@ const moduleMains = {}; | ||
function bareName(importSource) { | ||
if (isBuiltinModule(importSource)) { | ||
/* Don't rule out possibility that a built-in module could provide an html tag | ||
* but also avoid any additional processing of the module name. */ | ||
return importSource; | ||
} | ||
const importOwner = ownerName(importSource); | ||
@@ -26,0 +33,0 @@ const pkgMain = getPkgMain(importOwner); |
{ | ||
"name": "babel-plugin-template-html-minifier", | ||
"description": "Minify HTML in tagged template strings using html-minifier", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "index.js", | ||
@@ -26,12 +26,13 @@ "scripts": { | ||
"dependencies": { | ||
"html-minifier": "^3.5.3" | ||
"html-minifier": "^3.5.3", | ||
"is-builtin-module": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0-beta.49", | ||
"@polymer/lit-element": "^0.5.1", | ||
"ava": "^1.0.0-beta.4", | ||
"lit-html": "^0.10.0", | ||
"nyc": "^12.0.2", | ||
"xo": "^0.21.1" | ||
"@babel/core": "^7.1.0", | ||
"@polymer/lit-element": "^0.6.1", | ||
"ava": "^1.0.0-beta.8", | ||
"lit-html": "^0.11.4", | ||
"nyc": "^13.1.0", | ||
"xo": "^0.23.0" | ||
} | ||
} |
14
test.js
@@ -211,4 +211,4 @@ import test from 'ava'; | ||
test('ignore basic calls', t => babelTest(t, { | ||
source: `console.log('hello');`, | ||
result: `console.log('hello');` | ||
source: 'console.log(\'hello\');', | ||
result: 'console.log(\'hello\');' | ||
})); | ||
@@ -338,1 +338,11 @@ | ||
})); | ||
test('tolerate built-in modules', t => babelTest(t, { | ||
source: 'const fs = require(\'fs\');', | ||
result: 'const fs = require(\'fs\');', | ||
pluginOptions: { | ||
modules: { | ||
'choo/html': [null] | ||
} | ||
} | ||
})); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16785
451
0
2
+ Addedis-builtin-module@^3.0.0
+ Addedbuiltin-modules@3.3.0(transitive)
+ Addedis-builtin-module@3.2.1(transitive)