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

html-loader

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-loader - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

index.js

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

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