html-loader
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -50,3 +50,3 @@ /* | ||
content = htmlMinifier.minify(content, { | ||
removeComment: true, | ||
removeComments: true, | ||
collapseWhitespace: true, | ||
@@ -53,0 +53,0 @@ collapseBooleanAttributes: true, |
{ | ||
"name": "html-loader", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "html loader module for webpack", |
@@ -7,2 +7,4 @@ # html loader for webpack | ||
You can specify which tag-attribute combination should be processed by this loader via the query parameter `attrs`. Pass an array or a space-separated list of `<tag>:<attribute>` combinations. (Default: `attrs=img:src`) | ||
## Examples | ||
@@ -26,3 +28,3 @@ | ||
<!-- fileA.html --> | ||
<img src="image.jpg" data-src2x="image2x.png" > | ||
<img src="image.jpg" data-src="image2x.png" > | ||
``` | ||
@@ -32,13 +34,13 @@ | ||
require("html!./fileA.html"); | ||
// => '<img src="http://cdn.example.com/49e...ba9f/a9f...92ca.jpg" data-src2x="image2x.png" >' | ||
// => '<img src="http://cdn.example.com/49e...ba9f/a9f...92ca.jpg" data-src="image2x.png" >' | ||
require("html?attrs=img:data-src2c!./file.html"); | ||
// => '<img src="image.png" data-src2x="data:image/png;base64,..." >' | ||
require("html?attrs=img:data-src!./file.html"); | ||
// => '<img src="image.png" data-src="data:image/png;base64,..." >' | ||
require("html?attrs=img:src img:data-src2c!./file.html"); | ||
require("html?attrs[]=img:src&attrs[]=img:data-src2c!./file.html"); | ||
// => '<img src="http://cdn.example.com/49e...ba9f/a9f...92ca.jpg" data-src2x="data:image/png;base64,..." >' | ||
require("html?attrs=img:src img:data-src!./file.html"); | ||
require("html?attrs[]=img:src&attrs[]=img:data-src!./file.html"); | ||
// => '<img src="http://cdn.example.com/49e...ba9f/a9f...92ca.jpg" data-src="data:image/png;base64,..." >' | ||
/// minimized | ||
// => '<img src=http://cdn.example.com/49e...ba9f/a9f...92ca.jpg data-src2x=data:image/png;base64,...>' | ||
// => '<img src=http://cdn.example.com/49e...ba9f/a9f...92ca.jpg data-src=data:image/png;base64,...>' | ||
``` | ||
@@ -45,0 +47,0 @@ |
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
8100
48