Socket
Socket
Sign inDemoInstall

html-loader

Package Overview
Dependencies
Maintainers
3
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 4.0.0 to 4.1.0

3

dist/options.json

@@ -59,2 +59,5 @@ {

"instanceof": "Function"
},
"scriptingEnabled": {
"type": "boolean"
}

@@ -61,0 +64,0 @@ },

3

dist/plugins/sources-plugin.js

@@ -15,3 +15,4 @@ "use strict";

const document = (0, _parse.parse)(html, {
sourceCodeLocationInfo: true
sourceCodeLocationInfo: true,
scriptingEnabled: options.sources.scriptingEnabled
});

@@ -18,0 +19,0 @@ let needIgnore = false;

@@ -869,3 +869,4 @@ "use strict";

list: sources,
urlFilter: rawOptions.sources.urlFilter
urlFilter: rawOptions.sources.urlFilter,
scriptingEnabled: typeof rawOptions.sources.scriptingEnabled === "undefined" ? true : rawOptions.sources.scriptingEnabled
};

@@ -872,0 +873,0 @@ }

{
"name": "html-loader",
"version": "4.0.0",
"version": "4.1.0",
"description": "Html loader module for webpack",

@@ -49,9 +49,9 @@ "license": "MIT",

"devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@babel/cli": "^7.18.6",
"@babel/core": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^28.1.1",
"babel-jest": "^28.1.2",
"cross-env": "^7.0.3",

@@ -61,3 +61,3 @@ "del": "^6.1.1",

"es-check": "^6.2.1",
"eslint": "^8.16.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",

@@ -68,9 +68,9 @@ "eslint-plugin-import": "^2.26.0",

"husky": "^8.0.1",
"jest": "^28.1.1",
"lint-staged": "^13.0.1",
"memfs": "^3.4.4",
"jest": "^28.1.2",
"lint-staged": "^13.0.3",
"memfs": "^3.4.7",
"npm-run-all": "^4.1.5",
"posthtml": "^0.16.6",
"posthtml-webp": "^2.2.0",
"prettier": "^2.6.2",
"prettier": "^2.7.1",
"standard-version": "^9.5.0",

@@ -77,0 +77,0 @@ "unescape-unicode": "^0.2.0",

@@ -93,2 +93,3 @@ <div align="center">

) => boolean;
scriptingEnabled?: boolean;
};

@@ -372,3 +373,5 @@ ```

**Note:** source with a `tag` option takes precedence over source without.
> **Note**
>
> source with a `tag` option takes precedence over source without.

@@ -450,2 +453,39 @@ Filter can be used to disable default sources.

#### `scriptingEnabled`
Type:
```ts
type scriptingEnabled = boolean;
```
Default: `true`
By default, the parser in `html-loader` interprets content inside `<noscript>` tags as `#text`, so processing of content inside this tag will be ignored.
In order to enable processing inside `<noscript>` for content recognition by the parser as `#AST`, set this parameter to: `false`
Additional information: [scriptingEnabled](https://parse5.js.org/interfaces/parse5.ParserOptions.html#scriptingEnabled)
**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.html$/i,
loader: "html-loader",
options: {
sources: {
// Enables processing inside the <noscript> tag
scriptingEnabled: false,
},
},
},
],
},
};
```
### `preprocessor`

@@ -466,3 +506,5 @@

> ⚠ You should always return valid HTML
> **Warning**
>
> You should always return valid HTML

@@ -469,0 +511,0 @@ **file.hbs**

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