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

html-loader

Package Overview
Dependencies
Maintainers
10
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 2.1.1 to 2.1.2

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [2.1.2](https://github.com/webpack-contrib/html-loader/compare/v2.1.1...v2.1.2) (2021-03-09)
### Bug Fixes
* avoid using `file` protocol ([a309fe0](https://github.com/webpack-contrib/html-loader/commit/a309fe0654972b28d5f9639a97ad993342fb3e85))
### [2.1.1](https://github.com/webpack-contrib/html-loader/compare/v2.1.0...v2.1.1) (2021-02-24)

@@ -7,0 +14,0 @@

48

dist/utils.js

@@ -23,3 +23,3 @@ "use strict";

var _url = require("url");
var _path = _interopRequireDefault(require("path"));

@@ -816,2 +816,46 @@ var _HtmlSourceError = _interopRequireDefault(require("./HtmlSourceError"));

const WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]|^\\\\/;
const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
const absoluteToRequest = (context, maybeAbsolutePath) => {
if (maybeAbsolutePath[0] === '/') {
if (maybeAbsolutePath.length > 1 && maybeAbsolutePath[maybeAbsolutePath.length - 1] === '/') {
// this 'path' is actually a regexp generated by dynamic requires.
// Don't treat it as an absolute path.
return maybeAbsolutePath;
}
const querySplitPos = maybeAbsolutePath.indexOf('?');
let resource = querySplitPos === -1 ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
resource = _path.default.posix.relative(context, resource);
if (!resource.startsWith('../')) {
resource = `./${resource}`;
}
return querySplitPos === -1 ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
}
if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
const querySplitPos = maybeAbsolutePath.indexOf('?');
let resource = querySplitPos === -1 ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
resource = _path.default.win32.relative(context, resource);
if (!WINDOWS_ABS_PATH_REGEXP.test(resource)) {
resource = resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, '/');
if (!resource.startsWith('../')) {
resource = `./${resource}`;
}
}
return querySplitPos === -1 ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
} // not an absolute path
return maybeAbsolutePath;
};
const contextify = (context, request) => request.split('!').map(r => absoluteToRequest(context, r)).join('!');
const GET_SOURCE_FROM_IMPORT_NAME = '___HTML_LOADER_GET_SOURCE_FROM_IMPORT___';

@@ -824,3 +868,3 @@

const fileURLToHelper = (0, _url.pathToFileURL)(require.resolve('./runtime/getUrl.js'));
const fileURLToHelper = contextify(loaderContext.context, require.resolve('./runtime/getUrl.js'));
let code = options.esModule ? `import ${GET_SOURCE_FROM_IMPORT_NAME} from "${fileURLToHelper}";\n` : `var ${GET_SOURCE_FROM_IMPORT_NAME} = require("${fileURLToHelper}");\n`;

@@ -827,0 +871,0 @@

2

package.json
{
"name": "html-loader",
"version": "2.1.1",
"version": "2.1.2",
"description": "Html loader module for webpack",

@@ -5,0 +5,0 @@ "license": "MIT",

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